Skip to main content

Fatfs

Struct Fatfs 

Source
pub struct Fatfs<T> { /* private fields */ }
Expand description

Represents a FAT filesystem.

Implementations§

Source§

impl<T> Fatfs<T>

Source

pub fn new_sdcard<H>(drive: u8, sd_card_driver: T) -> Result<Self, EspError>
where T: BorrowMut<SdCardDriver<H>>,

Create a new FAT filesystem instance for a given SD card driver.

§Arguments
  • Drive number to assign to the filesystem.
  • SD card driver instance.
Source

pub fn drive(&self) -> u8

Get the drive number of the filesystem.

Source

pub fn format( &mut self, configuration: &FormatConfiguration, buf: &mut [u8], ) -> Result<(), EspError>

Format the partition with the given configuration.

§Arguments
  • Formatting configuration.
  • Buffer to use when formatting.
Source

pub fn mount(&mut self) -> Result<MountedFatfs<'_, T>, EspError>

Mount the filesystem and return a handle to it.

Source§

impl Fatfs<()>

Source

pub unsafe fn new_raw_part( drive: u8, partition: *const esp_partition_t, ) -> Result<Self, EspError>

Create a new - readonly - FAT filesystem instance for a given raw partition in the internal flash. This API is unsafe because currently esp-idf-hal does not have a safe way to represent a flash partition - neither a raw one, nor a wear-leveling one.

§Arguments
  • Drive number to assign to the filesystem.
  • Raw partition pointer.
§Safety

While the filesystem object is alive, the partition should not be modified elsewhere

Source

pub unsafe fn new_wl_part( drive: u8, partition: wl_handle_t, ) -> Result<Self, EspError>

Create a new FAT filesystem instance for a given raw partition in the internal flash. This API is unsafe because currently esp-idf-hal does not have a safe way to represent a flash partition - neither a raw one, nor a wear-leveling one.

§Arguments
  • Drive number to assign to the filesystem.
  • A handle to a wear-leveling partition.
§Safety

While the filesystem object is alive, the partition should not be modified elsewhere

Trait Implementations§

Source§

impl<T> Drop for Fatfs<T>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<T> Freeze for Fatfs<T>
where Partition<T>: Freeze,

§

impl<T> RefUnwindSafe for Fatfs<T>
where Partition<T>: RefUnwindSafe,

§

impl<T> Send for Fatfs<T>
where Partition<T>: Send,

§

impl<T> Sync for Fatfs<T>
where Partition<T>: Sync,

§

impl<T> Unpin for Fatfs<T>
where Partition<T>: Unpin,

§

impl<T> UnsafeUnpin for Fatfs<T>
where Partition<T>: UnsafeUnpin,

§

impl<T> UnwindSafe for Fatfs<T>
where Partition<T>: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

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

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = !

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

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

Performs the conversion.
§

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.