View Source ExZstd.CCtx (ex_zstd v0.5.2)
Compression context. To know more check out the ExZstd
doc.
Summary
Functions
Identical to compress!
. Wraps the result in a maybe instead of raising.
Compresses a chunk of data.
Identical to compress_stream!
. Wraps the result in a maybe instead of raising.
Writes a chunk of data into a compression stream.
Gets the value of a parameter of a compression context (cparam).
See ExZstd.Cparam
for more information.
Loads a decompression dictionary inside the decompresson context.
Creates a compression context.
Resets the compression context, interrupting any ongoing compression and resetting the parameters to their default values.
Sets a parameter of a compression context (cparam) to the given value.
See ExZstd.Cparam
for more information.
Sets the size of the following frame, only effective with stream compression.
Types
@type stream_end_directive() :: 0 | 1 | 2
@opaque t()
Functions
Identical to compress!
. Wraps the result in a maybe instead of raising.
@spec compress!(t(), binary()) :: binary()
@spec compress!(t(), binary()) :: maybe(binary(), ExZstd.error())
Compresses a chunk of data.
@spec compress_stream(t(), binary(), stream_end_directive()) :: maybe(binary(), ExZstd.error())
Identical to compress_stream!
. Wraps the result in a maybe instead of raising.
@spec compress_stream!(t(), binary(), stream_end_directive()) :: binary()
Writes a chunk of data into a compression stream.
@spec get_cparam(t(), ExZstd.Cparam.t()) :: integer()
Gets the value of a parameter of a compression context (cparam).
See ExZstd.Cparam
for more information.
Loads a decompression dictionary inside the decompresson context.
@spec new() :: t()
Creates a compression context.
@spec reset(t(), ExZstd.reset_directive()) :: t()
Resets the compression context, interrupting any ongoing compression and resetting the parameters to their default values.
@spec set_cparam(t(), ExZstd.Cparam.t(), integer()) :: t()
Sets a parameter of a compression context (cparam) to the given value.
See ExZstd.Cparam
for more information.
@spec set_pledged_src_size(t(), pos_integer()) :: t()
Sets the size of the following frame, only effective with stream compression.
@spec stream_continue() :: 0
@spec stream_end() :: 2
@spec stream_flush() :: 1