Skip to main content

File

Struct File 

Source
pub struct File { /* private fields */ }

Implementations§

Source§

impl File

Source

pub fn metadata(&self) -> Metadata

Gets the metadata about the file

Source

pub async fn flush<D, const SIZE: usize, const N: usize>( &mut self, fs: &mut FileSystem<D, SIZE, N>, ) -> ExFatResult<(), D, SIZE>
where D: BlockDevice<SIZE>,

Source

pub async fn close<D, const SIZE: usize, const N: usize>( self, fs: &mut FileSystem<D, SIZE, N>, ) -> ExFatResult<(), D, SIZE>
where D: BlockDevice<SIZE>,

Source

pub async fn read<D, const SIZE: usize, const N: usize>( &mut self, fs: &mut FileSystem<D, SIZE, N>, buf: &mut [u8], ) -> ExFatResult<Option<usize>, D, SIZE>
where D: BlockDevice<SIZE>,

Read bytes from file into buf and return the number of bytes read

Read begins at the cursor position and ends at the lesser of the buf or file length

Source

pub async fn write<D, const SIZE: usize, const N: usize>( &mut self, fs: &mut FileSystem<D, SIZE, N>, buf: &[u8], ) -> ExFatResult<(), D, SIZE>
where D: BlockDevice<SIZE>,

Writes all bytes from buf into the file from the file cursor position

This function will automatically increase the length of the file if necessary

Source

pub async fn seek<D, const SIZE: usize, const N: usize>( &mut self, fs: &mut FileSystem<D, SIZE, N>, cursor: u64, ) -> ExFatResult<(), D, SIZE>
where D: BlockDevice<SIZE>,

Seek to an offset, in bytes, in the file

Auto Trait Implementations§

§

impl Freeze for File

§

impl RefUnwindSafe for File

§

impl Send for File

§

impl Sync for File

§

impl Unpin for File

§

impl UnsafeUnpin for File

§

impl UnwindSafe for File

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 = !

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.