pub struct Dir<'a>(/* private fields */);Expand description
A directory inode.
Implementations§
Source§impl<'a> Dir<'a>
impl<'a> Dir<'a>
Sourcepub fn entries(&self) -> DirEntryIter<'a> ⓘ
pub fn entries(&self) -> DirEntryIter<'a> ⓘ
Iterate all entries in this directory, in ascending order of names.
Sourcepub fn get(&self, name: impl AsRef<[u8]>) -> Option<DirEntry<'a>>
pub fn get(&self, name: impl AsRef<[u8]>) -> Option<DirEntry<'a>>
Find the entry of given name in this directory.
In DwarFS, directory entries are listed in ascending order of names.
So get performs a binary search and the time complexity is
O(min(L, L0) log N) where L is the max length of entry names, L0
is the name.len() and N is the number of entries in this directory.
Trait Implementations§
impl<'a> Copy for Dir<'a>
Auto Trait Implementations§
impl<'a> Freeze for Dir<'a>
impl<'a> RefUnwindSafe for Dir<'a>
impl<'a> Send for Dir<'a>
impl<'a> Sync for Dir<'a>
impl<'a> Unpin for Dir<'a>
impl<'a> UnwindSafe for Dir<'a>
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