#[repr(C)]pub struct DirectoryBlockEntry {
pub inode: Option<InodeNumber>,
pub name_len: u8,
pub name: [u8; 251],
}Expand description
Represent a single directory entry within a directory block.
Each entry stores metadata for necessary to locate a file or subdirectory.
Fields§
§inode: Option<InodeNumber>The inode associated with this directory entry.
Some(inode): a valid file or directory.None: an unused or deleted entry.
name_len: u8The length of the file or directory name stored in name.
This indicates how many bytes in the name array are valid.
name: [u8; 251]The name of the file or directory.
Only the first name_len bytes are meaningful.
Implementations§
Source§impl DirectoryBlockEntry
impl DirectoryBlockEntry
Sourcepub fn from_ino_name(ino: InodeNumber, name: &str) -> Option<Self>
pub fn from_ino_name(ino: InodeNumber, name: &str) -> Option<Self>
Constructs a new directory entry from an inode number and name.
Returns None if the name is too long to fit in the directory entry.
§Arguments
ino: The inode number associated with the entry.name: The name of the file or directory.
§Returns
Some(Self): A valid directory entry.None: If the name is too long to fit.
Trait Implementations§
Source§impl Clone for DirectoryBlockEntry
impl Clone for DirectoryBlockEntry
Source§fn clone(&self) -> DirectoryBlockEntry
fn clone(&self) -> DirectoryBlockEntry
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DirectoryBlockEntry
impl Debug for DirectoryBlockEntry
Source§impl Default for DirectoryBlockEntry
impl Default for DirectoryBlockEntry
impl Copy for DirectoryBlockEntry
Auto Trait Implementations§
impl Freeze for DirectoryBlockEntry
impl RefUnwindSafe for DirectoryBlockEntry
impl Send for DirectoryBlockEntry
impl Sync for DirectoryBlockEntry
impl Unpin for DirectoryBlockEntry
impl UnwindSafe for DirectoryBlockEntry
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)