Type Alias CStream

Source
pub type CStream<'a> = CCtx<'a>;
Expand description

Compression stream.

Same as CCtx.

Aliased Type§

struct CStream<'a>(/* private fields */);

Implementations

Source§

impl<'a> CCtx<'a>

Source

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

Wraps the ZSTD_compressCCtx() function

Source

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

Wraps the ZSTD_compress2() function.

Source

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

Wraps the ZSTD_compress_usingDict() function.

Source

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

Wraps the ZSTD_compress_usingCDict() function.

Source

pub fn init(&mut self, compression_level: CompressionLevel) -> usize

Source

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

Source

pub fn ref_cdict<'b>(&mut self, cdict: &CDict<'b>) -> SafeResult
where 'b: 'a,

Wraps the ZSTD_CCtx_refCDict() function.

Dictionary must outlive the context.

Source

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

Source

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

Source

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

Wraps the ZSTD_compressStream2() function.

Source

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

Wraps the ZSTD_flushStream() function.

Source

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

Wraps the ZSTD_endStream() function.

Source

pub fn sizeof(&self) -> usize

Source

pub fn reset(&mut self, reset: ResetDirective) -> SafeResult

Source

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

Source

pub fn set_pledged_src_size(&mut self, pledged_src_size: u64) -> SafeResult

Source

pub fn in_size() -> usize

Source

pub fn out_size() -> usize

Source§

impl CCtx<'static>

Source

pub fn try_create() -> Option<Self>

Tries to create a new context.

Returns None if zstd returns a NULL pointer - may happen if allocation fails.

Source

pub fn create() -> Self

Wrap ZSTD_createCCtx

§Panics

If zstd returns a NULL pointer.

Trait Implementations

Source§

impl Default for CCtx<'_>

Source§

fn default() -> Self

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

impl<'a> Drop for CCtx<'a>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<'a> Send for CCtx<'a>