F3.Decoder.Native (F3 v0.1.0)

Copy Markdown

Calls the dirty-CPU NIF for one encoding unit.

The NIF is loaded only when F3_BUILD_NATIVE=1 was set at compile time. Otherwise decode/3 returns :native_unavailable and does not read a file. A panic inside the NIF comes back as {:error, %F3.Error{category: :corrupt}}.

Summary

Functions

Decodes bytes after applying compression, as type.

Functions

decode(bytes, compression, type)

@spec decode(binary(), atom(), atom()) ::
  {:ok, F3.Column.t()} | {:error, F3.Error.t()}

Decodes bytes after applying compression, as type.

Without the NIF this returns :native_unavailable and does not raise. A term that is not a binary or an atom raises FunctionClauseError.

Examples

iex> {:error, error} = F3.Decoder.Native.decode(<<>>, :uncompressed, :i64)
iex> error.category
:native_unavailable