[−][src]Struct sarc::SarcFile
An in-memory representation of a Sarc archive
Fields
byte_order: Endian
files: 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]
&self,
path: P
) -> Result<(), Error>
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
Auto Trait Implementations
impl RefUnwindSafe for SarcFile
impl Send for SarcFile
impl Sync for SarcFile
impl Unpin for SarcFile
impl UnwindSafe for SarcFile
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>,