[go: up one dir, main page]

Struct Decompress

Source
pub struct Decompress { /* private fields */ }
Expand description

In-memory state for decompressing brotli-encoded data.

This stream is at the heart of the I/O streams and is used to decompress an incoming brotli stream.

Implementations§

Source§

impl Decompress

Source

pub fn new() -> Decompress

Creates a new brotli decompression/decoding stream ready to receive data.

Source

pub fn decompress( &mut self, input: &mut &[u8], output: &mut &mut [u8], ) -> Result<DeStatus, Error>

Decompress some input data and write it to a buffer of output data.

This function will decompress the data in input and place the output in output, returning the result. Possible statuses that can be returned are that the stream is finished, more input is needed, or more output space is needed.

The input slice is updated to point to the remaining data that was not consumed, and the output slice is updated to point to the portion of the output slice that still needs to be filled in.

§Errors

If the input stream is not a valid brotli stream, then an error is returned.

Source

pub fn take_output(&mut self, size_limit: Option<usize>) -> Option<&[u8]>

Retrieve a slice of the internal decompressor buffer up to size_limit in length (unlimited length if None), consuming it. As the internal buffer may not be contiguous, consecutive calls may return more output until this function returns None.

Trait Implementations§

Source§

impl Drop for Decompress

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for Decompress

Source§

impl Sync for Decompress

Auto Trait Implementations§

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.