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

Link to this type

stream_end_directive()

View Source
@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.

Link to this function

compress_stream(cctx, data, end_directive)

View Source
@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.

Link to this function

compress_stream!(cctx, data, end_directive)

View Source
@spec compress_stream!(t(), binary(), stream_end_directive()) :: binary()

Writes a chunk of data into a compression stream.

Link to this function

get_cparam(cctx, cparam)

View Source
@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.

Link to this function

load_dictionary(dctx, dictionary)

View Source
@spec load_dictionary(t(), binary()) :: t()

Loads a decompression dictionary inside the decompresson context.

@spec new() :: t()

Creates a compression context.

Link to this function

reset(cctx, reset_directive)

View Source
@spec reset(t(), ExZstd.reset_directive()) :: t()

Resets the compression context, interrupting any ongoing compression and resetting the parameters to their default values.

Link to this function

set_cparam(cctx, cparam, value)

View Source
@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.

Link to this function

set_pledged_src_size(cctx, size)

View Source
@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