Struct Archive

Source
pub struct Archive<'a> { /* private fields */ }
Expand description

A squashfs filesystem archive.

Implementations§

Source§

impl<'a> Archive<'a>

Ways to create an archive.

Source

pub fn new<P>(path: P) -> Result<Self>
where P: AsRef<Path>,

Open a squashfs archive from a file.

Source

pub fn from_slice(data: &'a [u8]) -> Result<Self>

Open a squashfs archive from a slice of data.

Source

pub fn with_source<S: Source + 'a>(source: S) -> Result<Self>

Open a squashfs archive from a custom source.

Source§

impl<'a> Archive<'a>

Source

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

Open the root directory of the archive.

Source§

impl Archive<'_>

High level “easy” methods for interacting with the archive.

Source

pub fn read(&self, path: &str) -> Result<Vec<u8>>

Read the file at the given path

Source

pub fn exists(&self, path: &str) -> bool

Check if anything exists at the given path

Source

pub fn permissions(&self, path: &str) -> Result<Permissions>

Source§

impl Archive<'_>

Source

pub fn export_table(&self) -> Result<ExportTable<'_>>

Source§

impl Archive<'_>

Methods for opening files on an archive.

Source

pub fn open(&self, path: &str) -> Result<File<'_>>

Open a file by path.

This will follow symlinks. Use Self::open_nofollow to avoid following symlinks.

Source

pub fn open_nofollow(&self, path: &str) -> Result<File<'_>>

Open a file by path without following symlinks.

Source

pub fn open_raw(&self, path: &CStr) -> Result<File<'_>>

Open a file using a raw path (a CStr)

Source

pub fn open_raw_nofollow(&self, path: &CStr) -> Result<File<'_>>

Open a file using a raw path (a CStr) without following symlinks.

Source

pub fn open_ref(&self, inode_ref: InodeRef) -> Result<File<'_>>

Open a file by inode reference.

Source§

impl Archive<'_>

Source

pub fn id_table(&self) -> Result<IdTable<'_>>

Source§

impl Archive<'_>

Source

pub fn inode_map(&self) -> Result<InodeMap<'_>>

Source§

impl Archive<'_>

Source

pub fn path_resolver(&self) -> Result<PathResolver<'_>>

Create a new walker for the archive.

The walker starts at the root directory of the archive.

Source§

impl Archive<'_>

Trait Implementations§

Source§

impl<'a> Debug for Archive<'a>

Source§

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

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

impl Drop for Archive<'_>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<'a> Send for Archive<'a>

Source§

impl<'a> Sync for Archive<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Archive<'a>

§

impl<'a> RefUnwindSafe for Archive<'a>

§

impl<'a> Unpin for Archive<'a>

§

impl<'a> UnwindSafe for Archive<'a>

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, 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.