Struct ExplodeBuffer

Source
pub struct ExplodeBuffer<'a> { /* private fields */ }
Expand description

A handle to feed input to the decompressor.

This is the primary interface for low-level decompression. You can get an instance of this by providing an output buffer to Explode::with_buffer.

For a high-level example of how to use this interface, see Explode.

Implementations§

Source§

impl<'a> ExplodeBuffer<'a>

Source

pub fn feed(&mut self, input: u8) -> Result<()>

Feed in a byte input to decompress.

Signals a full output buffer by returning Ok(()). You can then get a reference to the full buffer with get, and reset the output buffer to empty with reset.

Note that you should feed in the same byte repeatedly to this function, until it signals it is ready for more input by returning Error::IncompleteInput. Doing anything else will result in a decompression failure or bad output.

Source

pub fn get(&self) -> &[u8]

Get a reference to the filled portion of the output buffer.

This is usually called after feed returns Ok(()).

Source

pub fn len(&self) -> usize

Return the amount of output produced so far.

Source

pub fn reset(&mut self)

Reset the output buffer to empty.

Note that this does not reset the entire decompressor state.

Source

pub fn done(&self) -> bool

Returns true if decompression is finished.

This does the same thing as Explode::done but is usable while a ExplodeBuffer is still in scope.

Trait Implementations§

Source§

impl<'a> Debug for ExplodeBuffer<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for ExplodeBuffer<'a>

§

impl<'a> RefUnwindSafe for ExplodeBuffer<'a>

§

impl<'a> Send for ExplodeBuffer<'a>

§

impl<'a> Sync for ExplodeBuffer<'a>

§

impl<'a> Unpin for ExplodeBuffer<'a>

§

impl<'a> !UnwindSafe for ExplodeBuffer<'a>

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> 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, 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.