fmf_contract/codes.rs
1//! Status codes — one table shared verbatim by the FFI return values and
2//! the pipe frame header (docs/ARCHITECTURE.md error code table).
3//!
4//! **Append only; renumbering is a breaking protocol change.** Downstream,
5//! fmf-ffi's `contract_tests` pin these against literals as an independent
6//! tripwire for accidental edits of this file.
7
8/// Success.
9pub const OK: i32 = 0;
10/// A caller-supplied argument was invalid (null/length contract violated,
11/// or a version mismatch on the pipe Hello handshake).
12pub const INVALID_ARG: i32 = 1;
13/// Structural generation moved (or a result handle was evicted) — the
14/// client re-runs the query.
15pub const STALE: i32 = 2;
16/// The operation needs administrator rights (MFT/USN access) that the
17/// caller lacks.
18pub const NOT_ADMIN: i32 = 3;
19/// A volume could not be opened or read (unsupported filesystem, missing,
20/// or otherwise unavailable).
21pub const VOLUME: i32 = 4;
22/// The query string failed to parse.
23pub const QUERY_SYNTAX: i32 = 5;
24/// An I/O error occurred (index file or volume read/write).
25pub const IO: i32 = 6;
26/// The index dir's writer lock is held by another process (single-writer
27/// invariant, cross-process).
28pub const LOCKED: i32 = 7;
29/// An internal panic was caught at the FFI/pipe boundary (`catch_unwind`);
30/// detail is available via `fmf_last_error`.
31pub const PANIC: i32 = 99;