pub struct Squashfs<'b> {
pub kind: Kind,
pub superblock: SuperBlock,
pub compression_options: Option<CompressionOptions>,
pub inodes: IntMap<u32, Inode>,
pub root_inode: Inode,
pub dir_blocks: (IntMap<u64, u64>, Vec<u8>),
pub fragments: Option<Vec<Fragment>>,
pub export: Option<Vec<Export>>,
pub id: Vec<Id>,
/* private fields */
}Expand description
Squashfs Image initial read information
See FilesystemReader for a representation with the data extracted and uncompressed.
Fields§
§kind: Kind§superblock: SuperBlock§compression_options: Option<CompressionOptions>Compression options that are used for the Compressor located after the Superblock
inodes: IntMap<u32, Inode>§root_inode: InodeRoot Inode
dir_blocks: (IntMap<u64, u64>, Vec<u8>)Bytes containing Directory Table (<OffsetFromImage, OffsetInData>, Data)
fragments: Option<Vec<Fragment>>Fragments Lookup Table Cache
export: Option<Vec<Export>>Export Lookup Table Cache
id: Vec<Id>Id Lookup Table Cache
Implementations§
Source§impl<'b> Squashfs<'b>
impl<'b> Squashfs<'b>
Sourcepub fn superblock_and_compression_options(
reader: &mut Box<dyn BufReadSeek + 'b>,
kind: &Kind,
) -> Result<(SuperBlock, Option<CompressionOptions>), BackhandError>
pub fn superblock_and_compression_options( reader: &mut Box<dyn BufReadSeek + 'b>, kind: &Kind, ) -> Result<(SuperBlock, Option<CompressionOptions>), BackhandError>
Read Superblock and Compression Options at current reader offset without parsing inodes
and dirs
Used for unsquashfs (extraction and –stat)
Sourcepub fn from_reader(reader: impl BufReadSeek + 'b) -> Result<Self, BackhandError>
pub fn from_reader(reader: impl BufReadSeek + 'b) -> Result<Self, BackhandError>
Create Squashfs from Reader, with the resulting squashfs having read all fields needed
to regenerate the original squashfs and interact with the fs in memory without needing to
read again from Reader. reader needs to start with the beginning of the Image.
Sourcepub fn from_reader_with_offset(
reader: impl BufReadSeek + 'b,
offset: u64,
) -> Result<Self, BackhandError>
pub fn from_reader_with_offset( reader: impl BufReadSeek + 'b, offset: u64, ) -> Result<Self, BackhandError>
Same as Self::from_reader, but seek’ing to offset in reader before Reading
Sourcepub fn from_reader_with_offset_and_kind(
reader: impl BufReadSeek + 'b,
offset: u64,
kind: Kind,
) -> Result<Self, BackhandError>
pub fn from_reader_with_offset_and_kind( reader: impl BufReadSeek + 'b, offset: u64, kind: Kind, ) -> Result<Self, BackhandError>
Same as Self::from_reader_with_offset, but including custom kind
Sourcepub fn into_filesystem_reader(
self,
) -> Result<FilesystemReader<'b>, BackhandError>
pub fn into_filesystem_reader( self, ) -> Result<FilesystemReader<'b>, BackhandError>
Convert into FilesystemReader by extracting all file bytes and converting into a filesystem
like structure in-memory
Auto Trait Implementations§
impl<'b> Freeze for Squashfs<'b>
impl<'b> !RefUnwindSafe for Squashfs<'b>
impl<'b> Send for Squashfs<'b>
impl<'b> !Sync for Squashfs<'b>
impl<'b> Unpin for Squashfs<'b>
impl<'b> !UnwindSafe for Squashfs<'b>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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