Struct rstb::ResourceSizeTable [−][src]
pub struct ResourceSizeTable { /* fields omitted */ }
Expand description
A representation of a Breath of the Wild Resource Size Table (RSTB) file
Implementations
impl ResourceSizeTable
[src]
impl ResourceSizeTable
[src]pub fn new() -> ResourceSizeTable
[src]
pub fn new() -> ResourceSizeTable
[src]Creates a new, blank RSTB. Probably not very useful, to be honest.
pub fn new_from_stock(endian: Endian) -> ResourceSizeTable
[src]
pub fn new_from_stock(endian: Endian) -> ResourceSizeTable
[src]Creates a new copy of a stock BOTW RSTB. Passing Endian::Big
will return the RSTB from
the 1.5.0 Wii U version, and passing Endian::Little
will return the RSTB from the 1.6.0
Switch version.
impl ResourceSizeTable
[src]
impl ResourceSizeTable
[src]pub fn from_binary<B: AsRef<[u8]>>(
data: B,
endian: Endian
) -> Result<ResourceSizeTable, Box<dyn Error>>
[src]
pub fn from_binary<B: AsRef<[u8]>>(
data: B,
endian: Endian
) -> Result<ResourceSizeTable, Box<dyn Error>>
[src]Parses an RSTB file from a buffer implementing Into<Vec<u8>>
using the specified
endianness. If the data is yaz0 compressed, it will be decompressed automatically.
pub fn write_binary<W: Write>(
&self,
writer: &mut W,
endian: Endian
) -> Result<(), Box<dyn Error>>
[src]
pub fn write_binary<W: Write>(
&self,
writer: &mut W,
endian: Endian
) -> Result<(), Box<dyn Error>>
[src]Writes the contents of an RSTB to a binary writer implementing Write
. Does not yaz0
compress, this is left to the user.
pub fn to_binary(
&self,
endian: Endian,
compress: bool
) -> Result<Vec<u8>, Box<dyn Error>>
[src]
pub fn to_binary(
&self,
endian: Endian,
compress: bool
) -> Result<Vec<u8>, Box<dyn Error>>
[src]Writes the binary content of an RSTB as Vec<u8>
, optionally with yaz0 compression.
pub fn name_entries(&self) -> Iter<'_, String, u32>
[src]
pub fn name_entries(&self) -> Iter<'_, String, u32>
[src]Iterates entries in the RSTB’s name table.
pub fn hash_entries(&self) -> Iter<'_, u32, u32>
[src]
pub fn hash_entries(&self) -> Iter<'_, u32, u32>
[src]Iterates entries in the RSTB’s CRC table.
pub fn get_size(&self, file: &str) -> Option<u32>
[src]
pub fn get_size(&self, file: &str) -> Option<u32>
[src]Attempts to retrieve the resource size of a file in the RSTB, returning None if there is no entry for the file. Checks the CRC table first and then the name table.
pub fn is_in_table(&self, file: &str) -> bool
[src]
pub fn is_in_table(&self, file: &str) -> bool
[src]Checks whether a file has an entry in the RSTB. Checks the CRC table first and then the name table.
pub fn set_size<I: Into<u32>>(&mut self, file: &str, size: I)
[src]
pub fn set_size<I: Into<u32>>(&mut self, file: &str, size: I)
[src]Sets the resource size of a file in the RSTB, adding an entry if one is not already present. Uses the CRC table only.
pub fn delete_entry(&mut self, file: &str)
[src]
pub fn delete_entry(&mut self, file: &str)
[src]Deletes an entry from the RSTB. Does nothing if the entry does not exist. Checks the CRC table first and then the name table.
Trait Implementations
impl BinRead for ResourceSizeTable
[src]
impl BinRead for ResourceSizeTable
[src]type Args = (usize,)
type Args = (usize,)
The type of arguments needed to be supplied in order to read this type, usually a tuple. Read more
fn read_options<R: Read + Seek>(
__binread_generated_var_reader: &mut R,
__binread_generated_var_options: &ReadOptions,
__binread_generated_var_arguments: Self::Args
) -> BinResult<Self>
[src]
fn read_options<R: Read + Seek>(
__binread_generated_var_reader: &mut R,
__binread_generated_var_options: &ReadOptions,
__binread_generated_var_arguments: Self::Args
) -> BinResult<Self>
[src]Read the type from the reader
fn read<R>(reader: &mut R) -> Result<Self, Error> where
R: Read + Seek,
[src]
fn read<R>(reader: &mut R) -> Result<Self, Error> where
R: Read + Seek,
[src]Read the type from the reader while assuming no arguments have been passed Read more
fn read_args<R>(reader: &mut R, args: Self::Args) -> Result<Self, Error> where
R: Read + Seek,
[src]
fn read_args<R>(reader: &mut R, args: Self::Args) -> Result<Self, Error> where
R: Read + Seek,
[src]Read the type from the reader using the specified arguments
fn after_parse<R>(
&mut self,
&mut R,
&ReadOptions,
Self::Args
) -> Result<(), Error> where
R: Read + Seek,
[src]
&mut self,
&mut R,
&ReadOptions,
Self::Args
) -> Result<(), Error> where
R: Read + Seek,
impl Clone for ResourceSizeTable
[src]
impl Clone for ResourceSizeTable
[src]fn clone(&self) -> ResourceSizeTable
[src]
fn clone(&self) -> ResourceSizeTable
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for ResourceSizeTable
[src]
impl Debug for ResourceSizeTable
[src]impl Default for ResourceSizeTable
[src]
impl Default for ResourceSizeTable
[src]fn default() -> ResourceSizeTable
[src]
fn default() -> ResourceSizeTable
[src]Returns the “default value” for a type. Read more
impl PartialEq<ResourceSizeTable> for ResourceSizeTable
[src]
impl PartialEq<ResourceSizeTable> for ResourceSizeTable
[src]fn eq(&self, other: &ResourceSizeTable) -> bool
[src]
fn eq(&self, other: &ResourceSizeTable) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &ResourceSizeTable) -> bool
[src]
fn ne(&self, other: &ResourceSizeTable) -> bool
[src]This method tests for !=
.
impl StructuralPartialEq for ResourceSizeTable
[src]
Auto Trait Implementations
impl RefUnwindSafe for ResourceSizeTable
impl Send for ResourceSizeTable
impl Sync for ResourceSizeTable
impl Unpin for ResourceSizeTable
impl UnwindSafe for ResourceSizeTable
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more