Skip to main content

Lz4

Struct Lz4 

Source
pub struct Lz4;
Expand description

Compression types 2 and 3: an LZ4 block, uncompressed as the maximum.

Trait Implementations§

Source§

impl BlockCodec for Lz4

Source§

fn decode( &self, input: &Bytes, uncompressed: u32, out: &mut DecodeBuf, ) -> Result<Decoded, Error>

lz4.block.decompress(data, uncompressed_size) (python-lz4 4.4.4 over liblz4 1.9.4’s LZ4_decompress_safe): a declared size above i32::MAX is python-lz4’s OverflowError (its argument parse, so first), and so, next, is an input above i32::MAX bytes, before anything is reserved or read; otherwise the block is scanned with liblz4’s exact control flow (lz4_run), which gives its verdict and the output’s length, and only then is the output allocated (that length, charged) and decoded. python-lz4 reserves the whole declared size before it decodes, so where the machine cannot reserve it UnityPy raises MemoryError and unityrs reads on (PARITY.md section 19.3, “a count UnityPy allocates before it reads”).

Source§

fn compressor( &self, _which: Codec, _meter: &Arc<Meter>, ) -> Result<Option<Arc<dyn BlockCodec>>, SaveError>

Capture a compressor and chunk policy for one payload, when needed. The default uses this registered codec directly.
Source§

fn decode_with_flags( &self, input: &Bytes, uncompressed: u32, _flags: u32, out: &mut DecodeBuf, ) -> Result<Decoded, Error>

Decode with the original bundle flags available to extension callbacks. Native codecs use only their registered compression type.
Source§

fn compress( &self, data: &[u8], which: Codec, meter: &Arc<Meter>, ) -> Result<Bytes, SaveError>

Compress a bundle block. The default preserves the native packer.
Source§

fn chunk_size( &self, which: Codec, _meter: &Arc<Meter>, ) -> Result<usize, SaveError>

The writer’s chunk bound, looked up once before writing the payload.
Source§

impl Clone for Lz4

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Lz4

Source§

impl Debug for Lz4

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Lz4

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Forget for Lz4

§

impl Freeze for Lz4

§

impl Move for Lz4

§

impl RefUnwindSafe for Lz4

§

impl Send for Lz4

§

impl Sync for Lz4

§

impl Unpin for Lz4

§

impl UnsafeUnpin for Lz4

§

impl UnwindSafe for Lz4

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.