[−][src]Struct rstb::ResourceSizeTable
A representation of a Breath of the Wild Resource Size Table (RSTB) file
Implementations
impl 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]
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.
pub fn to_text(&self) -> Result<String, Box<dyn Error>>
[src]
Creates a text representation of an RSTB as a JSON string.
pub fn from_text(text: &str) -> Result<ResourceSizeTable, Box<dyn Error>>
[src]
Reads an RSTB from a JSON representation.
impl ResourceSizeTable
[src]
pub fn from_binary<B: AsRef<[u8]>>(
data: B,
endian: Endian
) -> Result<ResourceSizeTable, Box<dyn Error>>
[src]
data: B,
endian: Endian
) -> Result<ResourceSizeTable, Box<dyn Error>>
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]
&self,
writer: &mut W,
endian: Endian
) -> Result<(), Box<dyn Error>>
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]
&self,
endian: Endian,
compress: bool
) -> Result<Vec<u8>, Box<dyn Error>>
Writes the binary content of an RSTB as Vec<u8>
, optionally with yaz0 compression.
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]
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]
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]
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]
type Args = (usize,)
The type of arguments needed to be supplied in order to read this type, usually a tuple. Read more
pub 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]
__binread_generated_var_reader: &mut R,
__binread_generated_var_options: &ReadOptions,
__binread_generated_var_arguments: Self::Args
) -> BinResult<Self>
pub fn after_parse<R: Read + Seek>(
&mut self,
__binread_generated_var_reader: &mut R,
__binread_generated_var_options: &ReadOptions,
__binread_generated_var_arguments: Self::Args
) -> BinResult<()>
[src]
&mut self,
__binread_generated_var_reader: &mut R,
__binread_generated_var_options: &ReadOptions,
__binread_generated_var_arguments: Self::Args
) -> BinResult<()>
pub fn read<R>(reader: &mut R) -> Result<Self, Error> where
R: Read + Seek,
[src]
R: Read + Seek,
pub fn read_args<R>(reader: &mut R, args: Self::Args) -> Result<Self, Error> where
R: Read + Seek,
[src]
R: Read + Seek,
pub fn args_default() -> Option<Self::Args>
[src]
impl Debug for ResourceSizeTable
[src]
impl Default for ResourceSizeTable
[src]
pub fn default() -> ResourceSizeTable
[src]
impl PartialEq<ResourceSizeTable> for ResourceSizeTable
[src]
pub fn eq(&self, other: &ResourceSizeTable) -> bool
[src]
pub fn ne(&self, other: &ResourceSizeTable) -> bool
[src]
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> 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>,