#[repr(i32)]pub enum FsCoreErrorCode {
Ok = 0,
Io = 1,
ShortRead = 2,
ReadOnly = 3,
OutOfBounds = 4,
Custom = 5,
NullArg = 6,
Panic = 7,
BadString = 8,
}Expand description
Numeric error codes mirrored across every sister crate’s C ABI.
#[repr(i32)] so the layout is identical to the matching C enum.
Variants§
Ok = 0
Success.
Io = 1
Underlying I/O failed.
ShortRead = 2
A read the source could not satisfy in full — it ran out of data. What a file-backed handle returns for a read off the end of the file, and what a slice returns for a read past its own end.
ReadOnly = 3
Write attempted on a read-only device.
OutOfBounds = 4
A request refused up front because its range lies outside the device’s declared size; nothing was transferred.
This crate returns it only for a write past the end of an RW
slice. It reaches reads from sister crates whose container
declares a virtual size (the img-* readers), and from this
crate’s caching / read-only / slice wrappers when they forward
such a parent’s error. A C consumer that only wants to know “the
read overran the device”, and does not control which crate opened
the handle, should accept this and FS_CORE_SHORT_READ alike —
and should not treat the pair as exhaustive, since a
callback-backed handle reports its host’s refusal as
FS_CORE_IO.
Custom = 5
Driver-specific error — message in the thread-local last-error.
NullArg = 6
One of the input pointers was null.
Panic = 7
catch_unwind caught a panic crossing the FFI boundary.
BadString = 8
Reserved. Never returned.
It was meant for a path that is not valid UTF-8, but the one
function that meets that case — fs_core_open_file — returns a
POINTER, not a code, so it reports the failure as NULL plus a
message and cannot return this. No other entry point takes a
path.
Kept rather than removed because the numbering is published in
include/fs_core.h and a consumer may already switch on 8;
renumbering the codes after it would be an ABI break for a
tidiness gain. A future path-taking function that returns a code
should use this rather than invent another.
Trait Implementations§
Source§impl Clone for FsCoreErrorCode
impl Clone for FsCoreErrorCode
Source§fn clone(&self) -> FsCoreErrorCode
fn clone(&self) -> FsCoreErrorCode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more