pub struct CCtx<'a>(_, _);
Implementations
sourceimpl<'a> CCtx<'a>
impl<'a> CCtx<'a>
sourcepub fn compress<C: WriteBuf + ?Sized>(
&mut self,
dst: &mut C,
src: &[u8],
compression_level: CompressionLevel
) -> SafeResult
pub fn compress<C: WriteBuf + ?Sized>(
&mut self,
dst: &mut C,
src: &[u8],
compression_level: CompressionLevel
) -> SafeResult
Wraps the ZSTD_compressCCtx()
function
sourcepub fn compress2<C: WriteBuf + ?Sized>(
&mut self,
dst: &mut C,
src: &[u8]
) -> SafeResult
pub fn compress2<C: WriteBuf + ?Sized>(
&mut self,
dst: &mut C,
src: &[u8]
) -> SafeResult
Wraps the ZSTD_compress2()
function.
sourcepub fn compress_using_dict<C: WriteBuf + ?Sized>(
&mut self,
dst: &mut C,
src: &[u8],
dict: &[u8],
compression_level: CompressionLevel
) -> SafeResult
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.
sourcepub fn compress_using_cdict<C: WriteBuf + ?Sized>(
&mut self,
dst: &mut C,
src: &[u8],
cdict: &CDict<'_>
) -> SafeResult
pub fn compress_using_cdict<C: WriteBuf + ?Sized>(
&mut self,
dst: &mut C,
src: &[u8],
cdict: &CDict<'_>
) -> SafeResult
Wraps the ZSTD_compress_usingCDict()
function.
pub fn init(&mut self, compression_level: CompressionLevel) -> usize
sourcepub fn init_src_size(
&mut self,
compression_level: CompressionLevel,
pledged_src_size: u64
) -> usize
👎 DeprecatedAvailable on crate feature experimental
only.
pub fn init_src_size(
&mut self,
compression_level: CompressionLevel,
pledged_src_size: u64
) -> usize
experimental
only.Wraps the ZSTD_initCStream_srcSize()
function.
sourcepub fn init_using_dict(
&mut self,
dict: &[u8],
compression_level: CompressionLevel
) -> SafeResult
👎 DeprecatedAvailable on crate feature experimental
only.
pub fn init_using_dict(
&mut self,
dict: &[u8],
compression_level: CompressionLevel
) -> SafeResult
experimental
only.Wraps the ZSTD_initCStream_usingDict()
function.
sourcepub fn init_using_cdict<'b>(&mut self, cdict: &CDict<'b>) -> SafeResult where
'b: 'a,
👎 DeprecatedAvailable on crate feature experimental
only.
pub fn init_using_cdict<'b>(&mut self, cdict: &CDict<'b>) -> SafeResult where
'b: 'a,
experimental
only.Wraps the ZSTD_initCStream_usingCDict()
function.
pub fn load_dictionary(&mut self, dict: &[u8]) -> SafeResult
sourcepub fn ref_cdict<'b>(&mut self, cdict: &CDict<'b>) -> SafeResult where
'b: 'a,
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.
pub fn ref_prefix<'b>(&mut self, prefix: &'b [u8]) -> SafeResult where
'b: 'a,
pub fn compress_stream<C: WriteBuf + ?Sized>(
&mut self,
output: &mut OutBuffer<'_, C>,
input: &mut InBuffer<'_>
) -> SafeResult
sourcepub fn compress_stream2<C: WriteBuf + ?Sized>(
&mut self,
output: &mut OutBuffer<'_, C>,
input: &mut InBuffer<'_>,
end_op: ZSTD_EndDirective
) -> SafeResult
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.
sourcepub fn flush_stream<C: WriteBuf + ?Sized>(
&mut self,
output: &mut OutBuffer<'_, C>
) -> SafeResult
pub fn flush_stream<C: WriteBuf + ?Sized>(
&mut self,
output: &mut OutBuffer<'_, C>
) -> SafeResult
Wraps the ZSTD_flushStream()
function.
sourcepub fn end_stream<C: WriteBuf + ?Sized>(
&mut self,
output: &mut OutBuffer<'_, C>
) -> SafeResult
pub fn end_stream<C: WriteBuf + ?Sized>(
&mut self,
output: &mut OutBuffer<'_, C>
) -> SafeResult
Wraps the ZSTD_endStream()
function.
pub fn sizeof(&self) -> usize
pub fn reset(&mut self, reset: ResetDirective) -> SafeResult
pub fn reset_cstream(&mut self, pledged_src_size: u64) -> SafeResult
👎 Deprecated
Available on crate feature
experimental
only.pub fn set_parameter(&mut self, param: CParameter) -> SafeResult
pub fn set_pledged_src_size(&mut self, pledged_src_size: u64) -> SafeResult
sourcepub fn try_clone(
&self,
pledged_src_size: Option<u64>
) -> Result<Self, ErrorCode>
Available on crate feature experimental
only.
pub fn try_clone(
&self,
pledged_src_size: Option<u64>
) -> Result<Self, ErrorCode>
experimental
only.Creates a copy of this context.
This only works before any data has been compressed. An error will be returned otherwise.
sourcepub fn get_block_size(&self) -> usize
Available on crate feature experimental
only.
pub fn get_block_size(&self) -> usize
experimental
only.Wraps the ZSTD_getBlockSize()
function.
sourcepub fn compress_block<C: WriteBuf + ?Sized>(
&mut self,
dst: &mut C,
src: &[u8]
) -> SafeResult
Available on crate feature experimental
only.
pub fn compress_block<C: WriteBuf + ?Sized>(
&mut self,
dst: &mut C,
src: &[u8]
) -> SafeResult
experimental
only.Wraps the ZSTD_compressBlock()
function.
pub fn in_size() -> usize
pub fn out_size() -> usize
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for CCtx<'a>
impl<'a> !Sync for CCtx<'a>
impl<'a> Unpin for CCtx<'a>
impl<'a> UnwindSafe for CCtx<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more