Struct zstd_safe::DCtx

source ·
pub struct DCtx<'a>(/* private fields */);
Expand description

A Decompression Context.

The lifetime references the potential dictionary used for this context.

If no dictionary was used, it will most likely be 'static.

Same as DStream.

Implementations§

source§

impl DCtx<'static>

source

pub fn try_create() -> Option<Self>

source

pub fn create() -> Self

source§

impl<'a> DCtx<'a>

source

pub fn decompress<C: WriteBuf + ?Sized>( &mut self, dst: &mut C, src: &[u8] ) -> SafeResult

Wraps the ZSTD_decompressDCtx() function.

source

pub fn decompress_using_dict<C: WriteBuf + ?Sized>( &mut self, dst: &mut C, src: &[u8], dict: &[u8] ) -> SafeResult

Wraps ZSTD_decompress_usingDict

source

pub fn decompress_using_ddict<C: WriteBuf + ?Sized>( &mut self, dst: &mut C, src: &[u8], ddict: &DDict<'_> ) -> SafeResult

Wraps the ZSTD_decompress_usingDDict() function.

source

pub fn init(&mut self) -> usize

Wraps the ZSTD_initCStream() function.

Initializes an existing DStream for decompression.

source

pub fn reset(&mut self) -> SafeResult

Wraps the ZSTD_resetDStream() function.

source

pub fn load_dictionary(&mut self, dict: &[u8]) -> SafeResult

source

pub fn ref_ddict<'b>(&mut self, ddict: &DDict<'b>) -> SafeResult
where 'b: 'a,

source

pub fn ref_prefix<'b>(&mut self, prefix: &'b [u8]) -> SafeResult
where 'b: 'a,

source

pub fn set_parameter(&mut self, param: DParameter) -> SafeResult

source

pub fn decompress_stream<C: WriteBuf + ?Sized>( &mut self, output: &mut OutBuffer<'_, C>, input: &mut InBuffer<'_> ) -> SafeResult

Wraps the ZSTD_decompressStream() function.

source

pub fn in_size() -> usize

Wraps the ZSTD_DStreamInSize() function.

Returns a hint for the recommended size of the input buffer for decompression.

source

pub fn out_size() -> usize

Wraps the ZSTD_DStreamOutSize() function.

Returns a hint for the recommended size of the output buffer for decompression.

source

pub fn sizeof(&self) -> usize

Wraps the ZSTD_sizeof_DCtx() function.

Trait Implementations§

source§

impl Default for DCtx<'_>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Drop for DCtx<'_>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Send for DCtx<'_>

Auto Trait Implementations§

§

impl<'a> Freeze for DCtx<'a>

§

impl<'a> RefUnwindSafe for DCtx<'a>

§

impl<'a> !Sync for DCtx<'a>

§

impl<'a> Unpin for DCtx<'a>

§

impl<'a> UnwindSafe for DCtx<'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.