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