pub struct Sarc<'a> { /* private fields */ }
Expand description
A simple SARC archive reader
Implementations
sourceimpl<'a> Sarc<'_>
impl<'a> Sarc<'_>
sourcepub fn new<T: Into<Cow<'a, [u8]>>>(data: T) -> Result<Sarc<'a>, SarcError>
pub fn new<T: Into<Cow<'a, [u8]>>>(data: T) -> Result<Sarc<'a>, SarcError>
Parses a SARC archive from binary data
sourcepub fn file_count(&self) -> usize
pub fn file_count(&self) -> usize
Get the number of files that are stored in the archive
sourcepub fn data_offset(&self) -> usize
pub fn data_offset(&self) -> usize
Get the offset to the beginning of file data
sourcepub fn file_at(&self, index: usize) -> Result<File<'_>, SarcError>
pub fn file_at(&self, index: usize) -> Result<File<'_>, SarcError>
Get a file by index. Returns error if index > file count.
sourcepub fn files(&self) -> impl Iterator<Item = File<'_>>
pub fn files(&self) -> impl Iterator<Item = File<'_>>
Returns an iterator over the contained files
sourcepub fn guess_min_alignment(&self) -> usize
pub fn guess_min_alignment(&self) -> usize
Guess the minimum data alignment for files that are stored in the archive
sourcepub fn are_files_equal(sarc1: &Sarc<'_>, sarc2: &Sarc<'_>) -> bool
pub fn are_files_equal(sarc1: &Sarc<'_>, sarc2: &Sarc<'_>) -> bool
Returns true is each archive contains the same files
Trait Implementations
impl Eq for Sarc<'_>
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.