SuperBlock

Struct SuperBlock 

Source
pub struct SuperBlock {
Show 19 fields pub magic: [u8; 4], pub inode_count: u32, pub mod_time: u32, pub block_size: u32, pub frag_count: u32, pub compressor: Compressor, pub block_log: u16, pub flags: u16, pub id_count: u16, pub version_major: u16, pub version_minor: u16, pub root_inode: u64, pub bytes_used: u64, pub id_table: u64, pub xattr_table: u64, pub inode_table: u64, pub dir_table: u64, pub frag_table: u64, pub export_table: u64,
}
Expand description

Contains important information about the archive, including the locations of other sections

Fields§

§magic: [u8; 4]

Must be set to 0x73717368 (“hsqs” on disk).

§inode_count: u32

The number of inodes stored in the archive.

§mod_time: u32

Last modification time of the archive. Count seconds since 00:00, Jan 1st 1970 UTC (not counting leap seconds). This is unsigned, so it expires in the year 2106 (as opposed to 2038).

§block_size: u32

The size of a data block in bytes. Must be a power of two between 4096 (4k) and 1048576 (1 MiB).

§frag_count: u32

The number of entries in the fragment table.

§compressor: Compressor

Compressor used for data

§block_log: u16

The log2 of the block size. If the two fields do not agree, the archive is considered corrupted.

§flags: u16

Bit wise OR of the flag bits

§id_count: u16

The number of entries in the ID lookup table.

§version_major: u16

Major version of the format. Must be set to 4.

§version_minor: u16

Minor version of the format. Must be set to 0.

§root_inode: u64

A reference to the inode of the root directory.

§bytes_used: u64

The number of bytes used by the archive. Because SquashFS archives must be padded to a multiple of the underlying device block size, this can be less than the actual file size.

§id_table: u64§xattr_table: u64§inode_table: u64§dir_table: u64§frag_table: u64§export_table: u64

Implementations§

Source§

impl SuperBlock

Source

pub fn inodes_uncompressed(&self) -> bool

flag value

Source

pub fn data_block_stored_uncompressed(&self) -> bool

flag value

Source

pub fn fragments_stored_uncompressed(&self) -> bool

flag value

Source

pub fn fragments_are_not_used(&self) -> bool

flag value

Source

pub fn fragments_are_always_generated(&self) -> bool

flag value

Source

pub fn data_has_been_deduplicated(&self) -> bool

flag value

Source

pub fn nfs_export_table_exists(&self) -> bool

flag value

Source

pub fn xattrs_are_stored_uncompressed(&self) -> bool

flag value

Source

pub fn no_xattrs_in_archive(&self) -> bool

flag value

Source

pub fn compressor_options_are_present(&self) -> bool

flag value

Source§

impl SuperBlock

Source

pub fn new(compressor: Compressor, kind: Kind) -> Self

Trait Implementations§

Source§

impl Clone for SuperBlock

Source§

fn clone(&self) -> SuperBlock

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SuperBlock

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl DekuReader<'_, ([u8; 4], u16, u16, Endian)> for SuperBlock

Source§

fn from_reader_with_ctx<R: Read + Seek>( __deku_reader: &mut Reader<R>, (ctx_magic, ctx_version_major, ctx_version_minor, ctx_type_endian): ([u8; 4], u16, u16, Endian), ) -> Result<Self, DekuError>

Construct type from reader implementing no_std_io::Read, with ctx. Read more
Source§

impl DekuUpdate for SuperBlock

Source§

fn update(&mut self) -> Result<(), DekuError>

Apply updates
Source§

impl DekuWriter<([u8; 4], u16, u16, Endian)> for SuperBlock

Source§

fn to_writer<W: Write + Seek>( &self, __deku_writer: &mut Writer<W>, (ctx_magic, ctx_version_major, ctx_version_minor, ctx_type_endian): ([u8; 4], u16, u16, Endian), ) -> Result<(), DekuError>

Write type to bytes
Source§

impl PartialEq for SuperBlock

Source§

fn eq(&self, other: &SuperBlock) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for SuperBlock

Source§

impl Eq for SuperBlock

Source§

impl StructuralPartialEq for SuperBlock

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more