pub struct Chunk<'bytes> {
pub mips: Option<RangeInclusive<u16>>,
/* private fields */
}
Expand description
Represents a chunk of a file within the FO4 virtual filesystem.
Fields§
§mips: Option<RangeInclusive<u16>>
Implementations§
source§impl<'bytes> Chunk<'bytes>
impl<'bytes> Chunk<'bytes>
pub fn compress(&self, options: &CompressionOptions) -> Result<Chunk<'static>>
pub fn decompress(&self, options: &CompressionOptions) -> Result<Chunk<'static>>
pub fn decompressed_len(&self) -> Option<usize>
pub fn is_compressed(&self) -> bool
pub fn is_decompressed(&self) -> bool
pub fn write<Out>( &self, stream: &mut Out, options: &CompressionOptions ) -> Result<()>
source§impl<'bytes> Chunk<'bytes>
impl<'bytes> Chunk<'bytes>
pub fn compress_into( &self, out: &mut Vec<u8>, options: &CompressionOptions ) -> Result<()>
pub fn decompress_into( &self, out: &mut Vec<u8>, options: &CompressionOptions ) -> Result<()>
Trait Implementations§
source§impl<'bytes> CompressableFrom<&'bytes [u8]> for Chunk<'bytes>
impl<'bytes> CompressableFrom<&'bytes [u8]> for Chunk<'bytes>
source§fn from_compressed(value: &'bytes [u8], decompressed_len: usize) -> Self
fn from_compressed(value: &'bytes [u8], decompressed_len: usize) -> Self
Makes a compressed instance of
Self
using the given data.source§fn from_decompressed(value: &'bytes [u8]) -> Self
fn from_decompressed(value: &'bytes [u8]) -> Self
Makes a decompressed instance of
Self
using the given data.Auto Trait Implementations§
impl<'bytes> RefUnwindSafe for Chunk<'bytes>
impl<'bytes> Send for Chunk<'bytes>
impl<'bytes> Sync for Chunk<'bytes>
impl<'bytes> Unpin for Chunk<'bytes>
impl<'bytes> UnwindSafe for Chunk<'bytes>
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