Skip to main content

FatFs

Struct FatFs 

Source
pub struct FatFs<R> { /* private fields */ }
Expand description

A pure-Rust reader over a FAT12/16/32 volume.

Implementations§

Source§

impl<R: Read + Seek> FatFs<R>

Source

pub fn open(reader: R) -> Result<Self>

Open a FAT volume, auto-detecting the variant from the boot sector.

Fails loud if the boot sector is not a recognized FAT/exFAT filesystem.

Source

pub fn variant(&self) -> FatVariant

The detected FAT variant.

Source

pub fn geometry(&self) -> &Geometry

The resolved on-disk volume geometry (variant, sector/cluster sizes, FAT layout, and byte offsets). Useful to a forensic consumer that needs the raw layout the reader computed.

Source

pub fn runs(&self, id: FileId) -> Result<Vec<(u64, u64)>>

Contiguous image byte runs (offset, len) backing node id’s data, merging physically adjacent clusters (the FAT12/16 fixed root is a single region run). Useful to a forensic consumer that needs the on-disk run list of a file or directory.

Source

pub fn root(&self) -> FileId

The root directory handle.

Source

pub fn read_dir(&self, id: FileId) -> Result<Vec<Node>>

List the entries of the directory id (allocated and deleted).

Source

pub fn lookup(&self, dir: FileId, name: &[u8]) -> Result<Option<FileId>>

Resolve a single child of dir by name (allocated entries only).

Source

pub fn meta(&self, id: FileId) -> Result<Node>

Resolve metadata for id.

Source

pub fn read_at(&self, id: FileId, off: u64, buf: &mut [u8]) -> Result<usize>

Read up to buf.len() bytes at byte offset off within node id. Returns the number of bytes read (0 at or past the end of the data).

Auto Trait Implementations§

§

impl<R> !Freeze for FatFs<R>

§

impl<R> RefUnwindSafe for FatFs<R>

§

impl<R> Send for FatFs<R>
where R: Send,

§

impl<R> Sync for FatFs<R>
where R: Send,

§

impl<R> Unpin for FatFs<R>
where R: Unpin,

§

impl<R> UnsafeUnpin for FatFs<R>
where R: UnsafeUnpin,

§

impl<R> UnwindSafe for FatFs<R>

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