Skip to main content

Error

Enum Error 

Source
#[non_exhaustive]
pub enum Error<E> {
Show 21 variants Device(E), BadBootSector, BadGeometry, NoPartition, NotFat32, NotExFat, Unsupported, FilesystemNotEnabled, InvalidCluster, NotFound, NotAFile, NotADirectory, InvalidName, NameTooLong, TruncatedFile, InvalidPosition, NoSpace, AlreadyExists, NotEmpty, FileTooLarge, InvalidOperation,
}
Expand description

What can go wrong mounting a volume or reading from it. E is the block device’s own error.

New variants may be added in a minor release.

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.
§

Device(E)

The block device failed.

§

BadBootSector

The boot sector is not valid (and neither is its backup).

§

BadGeometry

The boot sector describes a layout that does not fit the device or is inconsistent.

§

NoPartition

There is no filesystem at block 0 and no usable partition table.

§

NotFat32

The volume was expected to be FAT32 and is not.

§

NotExFat

The volume was expected to be exFAT and is not.

§

Unsupported

A valid filesystem this crate does not support (FAT12 or FAT16, TexFAT, a sector size other than 512).

§

FilesystemNotEnabled

The card holds a filesystem this build leaves out (the fat32 or exfat feature is off).

§

InvalidCluster

A cluster number in the filesystem points outside the volume: the volume is damaged.

§

NotFound

No file or directory at that path.

§

NotAFile

The path names a directory where a file was needed.

§

NotADirectory

The path names a file where a directory was needed (or runs through one).

§

InvalidName

The path or a name in it is not valid.

§

NameTooLong

A name is longer than 255 bytes of UTF-8 (the limit is in bytes, not characters, so that a name this crate writes can be read back).

§

TruncatedFile

The file’s cluster chain ends before its recorded size: the volume is damaged.

§

InvalidPosition

A seek past the end of the file.

§

NoSpace

The volume has no free cluster left (or no free directory slot, in a directory that cannot grow).

§

AlreadyExists

The path already names a file or directory.

§

NotEmpty

A directory that must be empty is not.

§

FileTooLarge

The file would be larger than the filesystem allows (4 GiB less one byte on FAT32).

§

InvalidOperation

The operation is not allowed here: a directory cannot move into itself, and a handle must belong to the filesystem it is used on.

Trait Implementations§

Source§

impl<E: Clone> Clone for Error<E>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<E: Copy> Copy for Error<E>

Source§

impl<E: Debug> Debug for Error<E>

Source§

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

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

impl<E: Eq> Eq for Error<E>

Source§

impl<E: PartialEq> PartialEq for Error<E>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<E: PartialEq> StructuralPartialEq for Error<E>

Auto Trait Implementations§

§

impl<E> Forget for Error<E>

§

impl<E> Freeze for Error<E>
where E: Freeze,

§

impl<E> Move for Error<E>

§

impl<E> RefUnwindSafe for Error<E>
where E: RefUnwindSafe,

§

impl<E> Send for Error<E>
where E: Send,

§

impl<E> Sync for Error<E>
where E: Sync,

§

impl<E> Unpin for Error<E>
where E: Unpin,

§

impl<E> UnsafeUnpin for Error<E>
where E: UnsafeUnpin,

§

impl<E> UnwindSafe for Error<E>
where E: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.