pub struct DirReader<R: Read + Seek> { /* private fields */ }Implementations§
Source§impl<R: Read + Seek> DirReader<R>
impl<R: Read + Seek> DirReader<R>
Sourcepub fn new(inode_reader: InodeReader<R>) -> Self
pub fn new(inode_reader: InodeReader<R>) -> Self
Wrap an InodeReader to provide directory-level access.
Sourcepub fn inode_reader(&self) -> &InodeReader<R>
pub fn inode_reader(&self) -> &InodeReader<R>
Borrow the underlying InodeReader.
Sourcepub fn inode_reader_mut(&mut self) -> &mut InodeReader<R>
pub fn inode_reader_mut(&mut self) -> &mut InodeReader<R>
Mutably borrow the underlying InodeReader.
Sourcepub fn read_dir(&mut self, dir_ino: u64) -> Result<Vec<DirEntry>>
pub fn read_dir(&mut self, dir_ino: u64) -> Result<Vec<DirEntry>>
Read all (live) directory entries from inode dir_ino.
Reads the inode’s data blocks and calls parse_dir_block on each
block-sized chunk, then filters out deleted entries (inode == 0).
Sourcepub fn lookup(&mut self, dir_ino: u64, name: &[u8]) -> Result<Option<u64>>
pub fn lookup(&mut self, dir_ino: u64, name: &[u8]) -> Result<Option<u64>>
Look up a single name in directory inode dir_ino.
Returns Ok(Some(ino)) when found, Ok(None) when not found.
Sourcepub fn resolve_path(&mut self, path: &str) -> Result<u64>
pub fn resolve_path(&mut self, path: &str) -> Result<u64>
Resolve an absolute path to an inode number.
Always starts at inode 2 (root). Follows symlinks up to
MAX_SYMLINK_DEPTH times. Returns Ext4Error::PathNotFound when
any component is missing.
Auto Trait Implementations§
impl<R> Freeze for DirReader<R>where
R: Freeze,
impl<R> RefUnwindSafe for DirReader<R>where
R: RefUnwindSafe,
impl<R> Send for DirReader<R>where
R: Send,
impl<R> Sync for DirReader<R>where
R: Sync,
impl<R> Unpin for DirReader<R>where
R: Unpin,
impl<R> UnsafeUnpin for DirReader<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for DirReader<R>where
R: UnwindSafe,
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
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