Enum Ext4Error

Source
#[non_exhaustive]
pub enum Ext4Error {
Show 15 variants NotAbsolute, NotASymlink, NotFound, IsADirectory, NotADirectory, IsASpecialFile, FileTooLarge, NotUtf8, MalformedPath, PathTooLong, TooManySymlinks, Encrypted, Io(Box<dyn Error + Send + Sync + 'static>), Incompatible(Incompatible), Corrupt(Corrupt),
}
Expand description

Common error type for all Ext4 operations.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

NotAbsolute

An operation that requires an absolute path was attempted on a relative path.

An operation that requires a symlink was attempted on a non-symlink file.

§

NotFound

A path points to a non-existent file.

§

IsADirectory

An operation that requires a non-directory path was attempted on a directory path.

§

NotADirectory

An operation that requires a directory path was attempted on a non-directory path.

§

IsASpecialFile

An operation that requires a regular file (or a symlink to a regular file) was attempted on a special file (fifo, character device, block device, or socket).

§

FileTooLarge

The file cannot be read into memory because it is too large.

§

NotUtf8

Data is not valid UTF-8.

§

MalformedPath

Data cannot be converted into a valid path.

§

PathTooLong

Path is too long.

Maximum path length is not strictly enforced by this library for all paths, but during path resolution the length may not exceed 4096 bytes.

Path could not be resolved because it contains too many levels of symbolic links.

§

Encrypted

Attempted to read an encrypted file.

Only unencrypted files are currently supported. Please file an issue if you have a use case for reading encrypted files.

§

Io(Box<dyn Error + Send + Sync + 'static>)

An IO operation failed. This error comes from the Ext4Read passed to Ext4::load.

Tuple Fields

§0: Box<dyn Error + Send + Sync + 'static>

Underlying error.

§

Incompatible(Incompatible)

The filesystem is not supported by this library. This does not indicate a problem with the filesystem, or with the calling code. Please file a feature request and include the incompatible features.

§

Corrupt(Corrupt)

The filesystem is corrupt in some way.

Implementations§

Source§

impl Ext4Error

Source

pub fn as_io(&self) -> Option<&(dyn Error + Send + Sync + 'static)>

If the error type is Ext4Error::Io, get the underlying error.

Trait Implementations§

Source§

impl Debug for Ext4Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Ext4Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for Ext4Error

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Ext4Error> for Error

Available on crate feature std only.
Source§

fn from(e: Ext4Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.