Image

Struct Image 

Source
pub struct Image<'i> {
    pub image: &'i [u8],
    pub header: &'i ComposefsHeader,
    pub blkszbits: u8,
    pub block_size: usize,
    pub sb: &'i Superblock,
    pub inodes: &'i [u8],
    pub xattrs: &'i [u8],
}
Expand description

Parsed EROFS image with references to key structures

Fields§

§image: &'i [u8]

Raw image bytes

§header: &'i ComposefsHeader

Composefs header

§blkszbits: u8

Block size in bits

§block_size: usize

Block size in bytes

§sb: &'i Superblock

Superblock

§inodes: &'i [u8]

Inode metadata region

§xattrs: &'i [u8]

Extended attributes region

Implementations§

Source§

impl<'img> Image<'img>

Source

pub fn open(image: &'img [u8]) -> Self

Opens an EROFS image from raw bytes

Source

pub fn inode(&self, id: u64) -> InodeType<'_>

Returns an inode by its ID

Source

pub fn shared_xattr(&self, id: u32) -> &XAttr

Returns a shared extended attribute by its ID

Source

pub fn block(&self, id: u64) -> &[u8]

Returns a data block by its ID

Source

pub fn data_block(&self, id: u64) -> &DataBlock

Returns a data block by its ID as a DataBlock reference

Source

pub fn directory_block(&self, id: u64) -> &DirectoryBlock

Returns a directory block by its ID

Source

pub fn root(&self) -> InodeType<'_>

Returns the root directory inode

Trait Implementations§

Source§

impl<'i> Debug for Image<'i>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'i> Freeze for Image<'i>

§

impl<'i> RefUnwindSafe for Image<'i>

§

impl<'i> Send for Image<'i>

§

impl<'i> Sync for Image<'i>

§

impl<'i> Unpin for Image<'i>

§

impl<'i> UnwindSafe for Image<'i>

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V