pub struct ErofsParser { /* private fields */ }Expand description
The parser for an EROFS image.
Implementations§
Source§impl ErofsParser
impl ErofsParser
Sourcepub fn new(reader: Arc<dyn Reader>) -> Result<Self, ErofsError>
pub fn new(reader: Arc<dyn Reader>) -> Result<Self, ErofsError>
Creates a new parser for an EROFS image from a reader.
Sourcepub fn block_size(&self) -> u64
pub fn block_size(&self) -> u64
Returns the block size of the EROFS image.
Sourcepub fn root_node(&self) -> DirectoryNode
pub fn root_node(&self) -> DirectoryNode
Returns the root node of the EROFS image.
Sourcepub fn read_file_range(
&self,
node: &FileNode,
offset: u64,
buf: &mut [u8],
) -> Result<usize, ErofsError>
pub fn read_file_range( &self, node: &FileNode, offset: u64, buf: &mut [u8], ) -> Result<usize, ErofsError>
Reads the data of the given file node into a buffer.
Sourcepub fn read_directory(
&self,
node: &DirectoryNode,
entry_offset: usize,
entries: &mut [DirectoryEntry],
) -> Result<usize, ErofsError>
pub fn read_directory( &self, node: &DirectoryNode, entry_offset: usize, entries: &mut [DirectoryEntry], ) -> Result<usize, ErofsError>
Read a number of entries from a directory, starting at entry_offset. Will retrieve up to the number of entries in the directory or the size of the provided buffer, returning the number of entries filled in the buffer. If there are less filled entries then the number of entry slots provided in the buffer, there are no more entries in this directory. Entries are sorted lexicographically. Reads past the end of the number of entries will return zero entries filled.
Sourcepub fn lookup(
&self,
dir: &DirectoryNode,
name: &str,
) -> Result<Option<Node>, ErofsError>
pub fn lookup( &self, dir: &DirectoryNode, name: &str, ) -> Result<Option<Node>, ErofsError>
Looks up a node by name in a directory.
Auto Trait Implementations§
impl Freeze for ErofsParser
impl !RefUnwindSafe for ErofsParser
impl Send for ErofsParser
impl Sync for ErofsParser
impl Unpin for ErofsParser
impl UnsafeUnpin for ErofsParser
impl !UnwindSafe for ErofsParser
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