Struct sarc_rs::Sarc [−][src]
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,