zigler v0.2.0 Zigler.Parser.Nif View Source
This datastructure represents structured information about a single nif
inside of a Zigler.sigil_Z/2
block. This is used to generate the
exported_nifs
variable which is an array of ErlNifFunc
structs. The
following keys are implemented:
- name: (
atom/0
) the function name to be bound into the module - arity: (
arity/0
) the arity of the erlang function (the zig function may have a different arity). - doc: (
iodata/0
) zig docstrings which should be turned into elixir docs - args: (
String.t/0
) a list of zig types which are the arguments for the function - retval: (
String.t/0
) the type of the return value opts: (
t:keyword
) list of nif options.- long: true -- if the nif should run in a separate OS thread.
- dirty: :cpu -- if the nif should run in a dirty cpu scheduler.
- dirty: :io -- if the nif should run in a dirty io scheduler.
Link to this section Summary
Link to this section Types
Link to this section Functions
Link to this function
validate_args(arg1, context, line)
View Sourcevalidate_args([String.t()], Parser.t(), non_neg_integer()) :: :ok | no_return()
Link to this function
validate_arity(rest, context, line)
View Sourcevalidate_arity([String.t()], Parser.t(), non_neg_integer()) :: :ok | no_return()
Link to this function
validate_retval(list, context, line)
View Sourcevalidate_retval([String.t()], Parser.t(), non_neg_integer()) :: :ok | no_return()