Struct yazi::Decoder

source ·
pub struct Decoder(/* private fields */);
Expand description

Stateful context for decompression.

See the crate level decompression section for detailed usage.

Implementations§

source§

impl Decoder

source

pub fn new() -> Self

Creates a new deflate decoder.

source

pub fn boxed() -> Box<Self>

Creates a new deflate decoder on the heap.

source

pub fn set_format(&mut self, format: Format)

Sets the expected format of the input data for the next usage of the decoder.

source

pub fn stream<'a, W: Write>( &'a mut self, writer: &'a mut W ) -> DecoderStream<'a, impl Sink + 'a>

Creates a decoder stream that will write into the specified writer.

source

pub fn stream_into_vec<'a>( &'a mut self, vec: &'a mut Vec<u8> ) -> DecoderStream<'a, impl Sink + 'a>

Creates a decoder stream that will write into the specified vector. The resulting stream will not clear the vector but will instead append the decompressed data.

source

pub fn stream_into_buf<'a>( &'a mut self, buf: &'a mut [u8] ) -> DecoderStream<'a, impl Sink + 'a>

Creates a decoder stream that will write into the specified buffer. The stream will generate an overflow error if the buffer is not large enough to contain the decompressed data.

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.