Struct fatfs::FileSystem

source ·
pub struct FileSystem<T: ReadWriteSeek> { /* private fields */ }
Expand description

A FAT filesystem object.

FileSystem struct is representing a state of a mounted FAT volume.

Implementations§

Creates a new filesystem object instance.

Supplied disk parameter cannot be seeked. If there is a need to read a fragment of disk image (e.g. partition) library user should wrap the file struct in a struct limiting access to partition bytes only e.g. fscommon::StreamSlice.

Note: creating multiple filesystem objects with one underlying device/disk image can cause a filesystem corruption.

Returns a type of File Allocation Table (FAT) used by this filesystem.

Returns a volume identifier read from BPB in the Boot Sector.

Returns a volume label from BPB in the Boot Sector as String.

Non-ASCII characters are replaced by the replacement character (U+FFFD). Note: File with VOLUME_ID attribute in root directory is ignored by this library. Only label from BPB is used.

Returns a volume label from BPB in the Boot Sector as byte array slice.

Label is encoded in the OEM codepage. Note: File with VOLUME_ID attribute in root directory is ignored by this library. Only label from BPB is used.

Returns a volume label from root directory as String.

It finds file with VOLUME_ID attribute and returns its short name.

Returns a volume label from root directory as byte array.

Label is encoded in the OEM codepage. It finds file with VOLUME_ID attribute and returns its short name.

Returns a root directory object allowing for futher penetration of a filesystem structure.

Returns status flags for this volume.

Returns filesystem statistics like number of total and free clusters.

For FAT32 volumes number of free clusters from FSInfo sector is returned (may be incorrect). For other FAT variants number is computed on the first call to this method and cached for later use.

Unmounts the filesystem.

Updates FSInfo sector if needed.

Trait Implementations§

Drop implementation tries to unmount the filesystem when dropping.

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.