ChunkDecompressor

Struct ChunkDecompressor 

Source
pub struct ChunkDecompressor<'src, T> { /* private fields */ }
Expand description

The decompressor is implemented as a Q buffer Q because it is a circular buffer + a linear buffer, which if you draw them, looks like a Q

Data is always decompressed in the circular buffer, but since the whole circular buffer might be needed when extracting new data, we temporarily store remaining data in the linear buffer.

The linear part would not be needed if we could control the maximum data that must be decompressed

Implementations§

Source§

impl<'src, 'buf> ChunkDecompressor<'src, &'buf mut [u8]>

Source

pub fn new_ref( data_chunks: &'src [u8], buffer: &'buf mut [u8], buffer_extra: &'buf mut [u8], check_crc: bool, ) -> Self

Source§

impl<'src> ChunkDecompressor<'src, Vec<u8>>

Source

pub fn new_vec(data_chunks: &'src [u8], check_crc: bool) -> Self

Source

pub fn update_buffers(&mut self)

Source§

impl<'src> ChunkDecompressor<'src, [u8; 32768]>

Source

pub fn new_static(data_chunks: &'src [u8], check_crc: bool) -> Self

Source§

impl<'src, T> ChunkDecompressor<'src, T>
where T: AsRef<[u8]> + AsMut<[u8]>,

Source

pub fn decode_next_scanline( &mut self, last_scanline: &mut [u8], bytes_per_pixel: usize, ) -> Result<(), DecodeError>

Source

pub fn reset(&mut self)

Auto Trait Implementations§

§

impl<'src, T> Freeze for ChunkDecompressor<'src, T>
where T: Freeze,

§

impl<'src, T> RefUnwindSafe for ChunkDecompressor<'src, T>
where T: RefUnwindSafe,

§

impl<'src, T> Send for ChunkDecompressor<'src, T>
where T: Send,

§

impl<'src, T> Sync for ChunkDecompressor<'src, T>
where T: Sync,

§

impl<'src, T> Unpin for ChunkDecompressor<'src, T>
where T: Unpin,

§

impl<'src, T> UnwindSafe for ChunkDecompressor<'src, T>
where T: UnwindSafe,

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> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
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<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
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> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.