pub struct DirEntry {
pub inode: u32,
pub rec_len: u16,
pub name: Vec<u8>,
pub file_type: DirEntryType,
}Expand description
A single directory entry parsed from an ext4 directory data block.
Layout (all little-endian): 0..4 inode u32 4..6 rec_len u16 6 name_len u8 7 file_type u8 8..8+name_len name bytes
Fields§
§inode: u32§rec_len: u16§name: Vec<u8>§file_type: DirEntryTypeImplementations§
Source§impl DirEntry
impl DirEntry
Sourcepub fn parse(buf: &[u8]) -> Result<Self>
pub fn parse(buf: &[u8]) -> Result<Self>
Parse a single directory entry from the start of buf.
Returns Err(TooShort) if the buffer is shorter than the 8-byte header
or shorter than the full entry (header + name).
Sourcepub fn is_deleted(&self) -> bool
pub fn is_deleted(&self) -> bool
An entry with inode == 0 has been deleted (the space is reused by rec_len).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DirEntry
impl RefUnwindSafe for DirEntry
impl Send for DirEntry
impl Sync for DirEntry
impl Unpin for DirEntry
impl UnsafeUnpin for DirEntry
impl UnwindSafe for DirEntry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more