Struct zstd::stream::raw::Decoder

source ·
pub struct Decoder<'a> { /* private fields */ }
Expand description

An in-memory decoder for streams of data.

Implementations§

source§

impl Decoder<'static>

source

pub fn new() -> Result<Self>

Creates a new decoder.

source

pub fn with_dictionary(dictionary: &[u8]) -> Result<Self>

Creates a new decoder initialized with the given dictionary.

source§

impl<'a> Decoder<'a>

source

pub fn with_context(context: &'a mut DCtx<'static>) -> Self

Creates a new decoder which employs the provided context for deserialization.

source

pub fn with_prepared_dictionary<'b>( dictionary: &DecoderDictionary<'b>, ) -> Result<Self>
where 'b: 'a,

Creates a new decoder, using an existing DecoderDictionary.

source

pub fn with_ref_prefix<'b>(ref_prefix: &'b [u8]) -> Result<Self>
where 'b: 'a,

Creates a new decoder, using a ref prefix

source

pub fn set_parameter(&mut self, parameter: DParameter) -> Result<()>

Sets a decompression parameter for this decoder.

Trait Implementations§

source§

impl Operation for Decoder<'_>

source§

fn run<C: WriteBuf + ?Sized>( &mut self, input: &mut InBuffer<'_>, output: &mut OutBuffer<'_, C>, ) -> Result<usize>

Performs a single step of this operation. Read more
source§

fn flush<C: WriteBuf + ?Sized>( &mut self, output: &mut OutBuffer<'_, C>, ) -> Result<usize>

Flushes any internal buffer, if any. Read more
source§

fn reinit(&mut self) -> Result<()>

Prepares the operation for a new frame. Read more
source§

fn finish<C: WriteBuf + ?Sized>( &mut self, _output: &mut OutBuffer<'_, C>, finished_frame: bool, ) -> Result<usize>

Finishes the operation, writing any footer if necessary. Read more
source§

fn run_on_buffers(&mut self, input: &[u8], output: &mut [u8]) -> Result<Status>

Performs a single step of this operation. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Decoder<'a>

§

impl<'a> RefUnwindSafe for Decoder<'a>

§

impl<'a> Send for Decoder<'a>

§

impl<'a> Sync for Decoder<'a>

§

impl<'a> Unpin for Decoder<'a>

§

impl<'a> !UnwindSafe for Decoder<'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>,

§

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

§

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.