pub struct GenericChunk {
pub length: u32,
pub data: Vec<u8>,
pub crc: u32,
/* private fields */
}Fields§
§length: u32§data: Vec<u8>§crc: u32Implementations§
Source§impl GenericChunk
impl GenericChunk
Sourcepub fn data_entries(
&mut self,
lookup_table: &HashLookupTable,
) -> Result<Vec<DataEntry>, Error>
pub fn data_entries( &mut self, lookup_table: &HashLookupTable, ) -> Result<Vec<DataEntry>, Error>
Returns the data entries of the chunk
Sourcepub fn from_data_entries(
entries: &Vec<DataEntry>,
lookup_table: &HashLookupTable,
) -> GenericChunk
pub fn from_data_entries( entries: &Vec<DataEntry>, lookup_table: &HashLookupTable, ) -> GenericChunk
Constructs the chunk from a Vec of Data entries and a hash lookup table
Sourcepub fn compress(&mut self, level: u32) -> Result<(), Error>
pub fn compress(&mut self, level: u32) -> Result<(), Error>
Compresses the data of the chunk using lzma with a level of 6
Sourcepub fn decompress(&mut self) -> Result<(), Error>
pub fn decompress(&mut self) -> Result<(), Error>
Decompresses the data of the chunk with lzma
Trait Implementations§
Source§impl Clone for GenericChunk
impl Clone for GenericChunk
Source§fn clone(&self) -> GenericChunk
fn clone(&self) -> GenericChunk
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GenericChunk
impl Debug for GenericChunk
Source§impl From<&HashLookupTable> for GenericChunk
impl From<&HashLookupTable> for GenericChunk
Source§fn from(chunk: &HashLookupTable) -> GenericChunk
fn from(chunk: &HashLookupTable) -> GenericChunk
Converts to this type from the input type.
Source§impl From<&MetaChunk> for GenericChunk
impl From<&MetaChunk> for GenericChunk
Source§fn from(chunk: &MetaChunk) -> GenericChunk
fn from(chunk: &MetaChunk) -> GenericChunk
Converts to this type from the input type.
Source§impl TryFrom<GenericChunk> for HashLookupTable
impl TryFrom<GenericChunk> for HashLookupTable
Auto Trait Implementations§
impl Freeze for GenericChunk
impl RefUnwindSafe for GenericChunk
impl Send for GenericChunk
impl Sync for GenericChunk
impl Unpin for GenericChunk
impl UnwindSafe for GenericChunk
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more