pub enum Error {
Io(Error),
OutOfBounds {
offset: u64,
len: u64,
size: u64,
},
InvalidImage(String),
Unsupported(String),
InvalidArgument(String),
Streaming {
kind: &'static str,
op: &'static str,
},
Immutable {
kind: &'static str,
op: &'static str,
},
}Expand description
Crate-wide error type.
Variants§
Io(Error)
Underlying I/O failure (file backend, host file source, etc.).
OutOfBounds
A block-device operation referenced a byte range that lies (partly or wholly) outside the device’s logical extent. Includes slice violations.
InvalidImage(String)
On-disk structure failed validation (bad magic, bad checksum, etc.).
Unsupported(String)
The requested feature exists in the format but is not implemented in this build of fstool. Used for clean “FAT32 not in v1” type messages.
InvalidArgument(String)
A user-supplied value was malformed or contradictory (bad spec, etc.).
Streaming
The operation tried to modify a streaming filesystem — one
whose writer can’t seek backward once bytes have been emitted.
Tar today; any future stream-of-records format that lands in
fstool. Distinct from Error::Immutable so callers can tell
“the writer fundamentally can’t go back” apart from “the
on-disk layout was never designed for in-place edits.”
Fields
Immutable
The operation tried to modify a write-once filesystem whose
on-disk layout has no in-place mutation hooks (no free-block
tracking, no journal). ISO 9660 and SquashFS today. The
writer can seek, but re-opening the image as writable isn’t
part of the format’s design — modifications go through
fstool repack to rebuild the image from scratch.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()