[][src]Struct sarc::SarcFile

pub struct SarcFile {
    pub byte_order: Endian,
    pub files: Vec<SarcEntry>,
}

An in-memory representation of a Sarc archive

Fields

byte_order: Endianfiles: Vec<SarcEntry>

Implementations

impl SarcFile[src]

pub fn read_from_file<P: AsRef<Path>>(path: P) -> Result<Self, Error>[src]

Read a sarc file (with or without compression) from a file.

Note: Compression requires the yaz0_sarc and/or the zstd_sarc features.

pub fn read(data: &[u8]) -> Result<Self, Error>[src]

Read a sarc file (with or without compression) from a byte slice.

Note: Compression requires the yaz0_sarc and/or the zstd_sarc features.

impl SarcFile[src]

pub fn write_to_file<P: AsRef<Path>>(&self, path: P) -> Result<()>[src]

Write

pub fn write_to_compressed_file<P: AsRef<Path>>(
    &self,
    path: P
) -> Result<(), Error>
[src]

Write to a compressed file. This writes the SARC with yaz0 compression. Requires either the yaz0_sarc feature or zstd_sarc feature enabled.

Note: If yaz0 compression is disabled and zstd compression is enabled, this will write with zstd compression.

pub fn write_to_yaz0_file<P: AsRef<Path>>(&self, path: P) -> Result<(), Error>[src]

Write to a compressed file. This writes the SARC with yaz0 compression. Requires yaz0_sarc feature

pub fn write_yaz0<W: Write>(&self, f: &mut W) -> Result<(), Error>[src]

Write to a writer that implements std::io::Write. This writes the SARC with yaz0 compression. Requires yaz0_sarc feature.

pub fn write_zstd<W: Write>(&self, f: &mut W) -> Result<(), Error>[src]

Write to a writer that implements std::io::Write. This writes the SARC with zstd compression. Requires zstd_sarc feature.

pub fn write<W: Write>(&self, f: &mut W) -> Result<()>[src]

Write to a writer that implements std::io::Write. This writes the SARC with no compression.

Trait Implementations

impl Debug for SarcFile[src]

Auto Trait Implementations

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.