Struct fatfs::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>
where IO: Seek + Write + Read,

§

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>
where IO: Seek + Write + Read,

§

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

§

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

§

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

§

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.