pub enum Error {
Show 20 variants
Io(Error),
BadMagic {
found: u16,
expected: u16,
},
BadChecksum {
what: &'static str,
},
UnsupportedIncompat(u32),
UnsupportedRoCompat(u32),
NotFound,
NotADirectory,
IsADirectory,
AlreadyExists,
DirectoryNotEmpty,
ReadOnly,
NameTooLong,
NoSpaceLeftOnDevice,
InvalidArgument(&'static str),
InvalidInode(u32),
InvalidBlock(u64),
OutOfBounds,
CorruptExtentTree(&'static str),
CorruptDirEntry(&'static str),
Corrupt(&'static str),
}Variants§
Io(Error)
Underlying device I/O failure.
BadMagic
Magic number mismatch — not an ext4 filesystem.
BadChecksum
On-disk structure failed checksum validation.
UnsupportedIncompat(u32)
Filesystem uses an INCOMPAT feature we don’t implement.
UnsupportedRoCompat(u32)
Filesystem uses a RO_COMPAT feature we don’t implement (read-only mount required anyway).
NotFound
Path component or inode not found.
NotADirectory
Path resolution hit a non-directory mid-walk.
IsADirectory
Operation refused because the target is a directory and the syscall
only operates on regular files (POSIX EISDIR — used by unlink(2),
truncate(2), etc).
AlreadyExists
Target already exists (POSIX EEXIST — used by create(2), mkdir(2),
rename(2) when no-replace is requested).
DirectoryNotEmpty
Directory must be empty (POSIX ENOTEMPTY — used by rmdir(2),
rename(2) replacing a non-empty dir).
ReadOnly
Write attempted on a device opened read-only (POSIX EROFS).
NameTooLong
Path component longer than EXT4_NAME_LEN (255 bytes) — POSIX ENAMETOOLONG.
NoSpaceLeftOnDevice
Container (xattr in-inode region, xattr block, etc.) has no free space for the requested entry — POSIX ENOSPC.
InvalidArgument(&'static str)
Caller passed a malformed argument or attempted a semantically invalid mutation (POSIX EINVAL — e.g. truncate-grow, moving a dir into its own subtree, operating on a legacy non-EXTENTS inode).
InvalidInode(u32)
Inode number is invalid (0, > total inodes, etc.).
InvalidBlock(u64)
Block number is invalid (> total blocks).
OutOfBounds
Read/write past end of file.
CorruptExtentTree(&'static str)
Extent tree structure is corrupt.
CorruptDirEntry(&'static str)
Directory entry corrupt (rec_len out of range, name too long, etc.).
Corrupt(&'static str)
Generic spec-violation error.
Implementations§
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · 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()