Enum ext4_view::Ext4Error

source ·
pub enum Ext4Error {
    NotAbsolute,
    NotASymlink,
    NotFound,
    IsADirectory,
    NotADirectory,
    IsASpecialFile,
    FileTooLarge,
    NotUtf8,
    MalformedPath,
    Io(Box<dyn IoError>),
    Incompatible(Incompatible),
    Corrupt(Corrupt),
}
Expand description

Common error type for all Ext4 operations.

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.

§

Io(Box<dyn IoError>)

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

Tuple Fields

§0: Box<dyn IoError>

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_corrupt(&self) -> Option<&Corrupt>

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

source

pub fn as_incompatible(&self) -> Option<&Incompatible>

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

source

pub fn as_io(&self) -> Option<&dyn IoError>

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

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§

default 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>,

§

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>,

§

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.