sdmmc_async/error.rs
1/// What can go wrong mounting a volume or reading from it. `E` is the block device's own error.
2///
3/// New variants may be added in a minor release.
4#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5#[non_exhaustive]
6pub enum Error<E> {
7 /// The block device failed.
8 Device(E),
9 /// The boot sector is not valid (and neither is its backup).
10 BadBootSector,
11 /// The boot sector describes a layout that does not fit the device or is inconsistent.
12 BadGeometry,
13 /// There is no filesystem at block 0 and no usable partition table.
14 NoPartition,
15 /// The volume was expected to be FAT32 and is not.
16 NotFat32,
17 /// The volume was expected to be exFAT and is not.
18 NotExFat,
19 /// A valid filesystem this crate does not support (FAT12 or FAT16, TexFAT, a sector size other than 512).
20 Unsupported,
21 /// The card holds a filesystem this build leaves out (the `fat32` or `exfat` feature is off).
22 FilesystemNotEnabled,
23 /// A cluster number in the filesystem points outside the volume: the volume is damaged.
24 InvalidCluster,
25 /// No file or directory at that path.
26 NotFound,
27 /// The path names a directory where a file was needed.
28 NotAFile,
29 /// The path names a file where a directory was needed (or runs through one).
30 NotADirectory,
31 /// The path or a name in it is not valid.
32 InvalidName,
33 /// 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
34 /// be read back).
35 NameTooLong,
36 /// The file's cluster chain ends before its recorded size: the volume is damaged.
37 TruncatedFile,
38 /// A seek past the end of the file.
39 InvalidPosition,
40 /// The volume has no free cluster left (or no free directory slot, in a directory that cannot grow).
41 NoSpace,
42 /// The path already names a file or directory.
43 AlreadyExists,
44 /// A directory that must be empty is not.
45 NotEmpty,
46 /// The file would be larger than the filesystem allows (4 GiB less one byte on FAT32).
47 FileTooLarge,
48 /// The operation is not allowed here: a directory cannot move into itself, and a handle must belong to the filesystem it
49 /// is used on.
50 InvalidOperation,
51}