Crate sqsh_rs

Source
Expand description

§Sqsh-rs Crates.io Docs.rs License

A Rust wrapper for the libsqsh library.

§Example

This is a simple example that a) prints the content of a file and b) lists the content of a directory.

use std::io::Write;
use sqsh_rs::Archive;

fn example() -> std::io::Result<()> {
    let mut archive = Archive::new("tests/data/test.sqsh")?;
    let contents: Vec<u8> = archive.read("/subdir/short.file")?;
    std::io::stdout().write_all(&contents)?;

    let directory = archive.open("/subdir")?;
    let mut iter = directory.as_dir()?;
    while let Some(entry) = iter.advance()? {
        println!("{}", entry.name());
    }

    Ok(())
}

example().unwrap();

Re-exports§

pub use crate::superblock::Compression;
pub use crate::superblock::Superblock;
pub use sqsh_sys as ffi;

Modules§

superblock
traverse

Structs§

Archive
A squashfs filesystem archive.
DirectoryEntry
DirectoryIterator
Error
ExportTable
A mapping from inode numbers to inode references.
File
A file in a squashfs archive.
IdTable
Inode
An inode number.
InodeMap
A map of inodes to inode references.
InodeRef
A unique reference to an inode.
PathResolver
A walker over the tree of entries in an archive.
Permissions
PermissionsStr
Reader
UnknownXattrType
XattrEntry
XattrIterator
ZeroInode
An error indicating that an inode number was zero.

Enums§

FileType
XattrType

Traits§

Source
A trait for mapping sections of an archive into memory.

Type Aliases§

Result