Struct sarc_rs::Sarc[][src]

pub struct Sarc<'a> { /* fields omitted */ }

A simple SARC archive reader

Implementations

impl<'a> Sarc<'_>[src]

pub fn new(data: &'a [u8]) -> Result<Sarc<'a>, SarcError>[src]

Parses a SARC archive from binary data

pub fn file_count(&self) -> usize[src]

Get the number of files that are stored in the archive

pub fn data_offset(&self) -> usize[src]

Get the offset to the beginning of file data

pub fn endian(&self) -> Endian[src]

Get the archive endianness

pub fn get_file(&self, file: &str) -> Result<Option<File<'_>>, SarcError>[src]

Get a file by name

pub fn file_at(&self, index: usize) -> Result<File<'_>, SarcError>[src]

Get a file by index. Returns error if index > file count.

pub fn files(&self) -> impl Iterator<Item = File<'_>>[src]

Returns an iterator over the contained files

pub fn guess_min_alignment(&self) -> usize[src]

Guess the minimum data alignment for files that are stored in the archive

pub fn are_files_equal(sarc1: &Sarc<'_>, sarc2: &Sarc<'_>) -> bool[src]

Returns true is each archive contains the same files

Trait Implementations

impl<'a> Debug for Sarc<'a>[src]

impl PartialEq<Sarc<'_>> for Sarc<'_>[src]

fn eq(&self, other: &Self) -> bool[src]

Returns true if and only if the raw archive data is identical

Auto Trait Implementations

impl<'a> RefUnwindSafe for Sarc<'a>

impl<'a> Send for Sarc<'a>

impl<'a> Sync for Sarc<'a>

impl<'a> Unpin for Sarc<'a>

impl<'a> UnwindSafe for Sarc<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.