pub struct Archive { /* private fields */ }
Expand description
An open SquashFS archive.
Implementations§
Source§impl Archive
impl Archive
Sourcepub fn get_exists<T: AsRef<Path>>(&self, path: T) -> Result<Node<'_>>
pub fn get_exists<T: AsRef<Path>>(&self, path: T) -> Result<Node<'_>>
Get the Node
located at the given path, raising an error if it does not exist.
Sourcepub fn get<T: AsRef<Path>>(&self, path: T) -> Result<Option<Node<'_>>>
pub fn get<T: AsRef<Path>>(&self, path: T) -> Result<Option<Node<'_>>>
Get the Node
located at the given path in the archive.
If the path is not present, Ok(None)
will be returned.
Sourcepub fn get_id(&self, id: u64) -> Result<Node<'_>>
pub fn get_id(&self, id: u64) -> Result<Node<'_>>
Get a node from the archive by its inode number.
Each inode in an archive has a unique ID. If the archive was created with the “exportable”
option (intended for exporting over NFS), it is efficient to look up inodes by their IDs.
If this archive is not exportable, SquashfsError::Unsupported
will be raised. A Node
obtained in this way will lack path information, and as such operations like getting its
file name or parent will fail.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Archive
impl RefUnwindSafe for Archive
impl Unpin for Archive
impl UnwindSafe for Archive
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