fatfs

Struct DirEntry

Source
pub struct DirEntry<'a, IO: ReadWriteSeek, TP, OCC> { /* private fields */ }
Expand description

A FAT directory entry.

DirEntry is returned by DirIter when reading a directory.

Implementations§

Source§

impl<'a, IO: ReadWriteSeek, TP, OCC: OemCpConverter> DirEntry<'a, IO, TP, OCC>

Source

pub fn short_file_name(&self) -> String

Returns short file name.

Non-ASCII characters are replaced by the replacement character (U+FFFD).

Source

pub fn short_file_name_as_bytes(&self) -> &[u8]

Returns short file name as byte array slice.

Characters are encoded in the OEM codepage.

Source

pub fn long_file_name_as_ucs2_units(&self) -> Option<&[u16]>

Returns long file name as u16 array slice.

Characters are encoded in the UCS-2 encoding.

Source

pub fn file_name(&self) -> String

Returns long file name or if it doesn’t exist fallbacks to short file name.

Source

pub fn attributes(&self) -> FileAttributes

Returns file attributes.

Source

pub fn is_dir(&self) -> bool

Checks if entry belongs to directory.

Source

pub fn is_file(&self) -> bool

Checks if entry belongs to regular file.

Source

pub fn to_file(&self) -> File<'a, IO, TP, OCC>

Returns File struct for this entry.

Panics if this is not a file.

Source

pub fn to_dir(&self) -> Dir<'a, IO, TP, OCC>

Returns Dir struct for this entry.

Panics if this is not a directory.

Source

pub fn len(&self) -> u64

Returns file size or 0 for directory.

Source

pub fn created(&self) -> DateTime

Returns file creation date and time.

Resolution of the time field is 1/100s.

Source

pub fn accessed(&self) -> Date

Returns file last access date.

Source

pub fn modified(&self) -> DateTime

Returns file last modification date and time.

Resolution of the time field is 2s.

Source

pub fn eq_name(&self, name: &str) -> bool

Performs a case-insensitive comparison against the given name.

Trait Implementations§

Source§

impl<'a, IO: Clone + ReadWriteSeek, TP: Clone, OCC: Clone> Clone for DirEntry<'a, IO, TP, OCC>

Source§

fn clone(&self) -> DirEntry<'a, IO, TP, OCC>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<IO: ReadWriteSeek, TP, OCC> Debug for DirEntry<'_, IO, TP, OCC>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, IO, TP, OCC> Freeze for DirEntry<'a, IO, TP, OCC>

§

impl<'a, IO, TP, OCC> !RefUnwindSafe for DirEntry<'a, IO, TP, OCC>

§

impl<'a, IO, TP, OCC> !Send for DirEntry<'a, IO, TP, OCC>

§

impl<'a, IO, TP, OCC> !Sync for DirEntry<'a, IO, TP, OCC>

§

impl<'a, IO, TP, OCC> Unpin for DirEntry<'a, IO, TP, OCC>

§

impl<'a, IO, TP, OCC> !UnwindSafe for DirEntry<'a, IO, TP, OCC>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.