Attribute Macro ocaml::bytecode_func

source · []
#[bytecode_func]
Expand description

bytecode_func is used export Rust functions to OCaml, performing the necessary wrapping/unwrapping automatically.

Since this is automatically applied to func functions, this is primarily be used when working with unboxed functions, or native_funcs directly. ocaml::body is not applied since this is typically used to call the native function, which is wrapped with ocaml::body or performs the equivalent work to register values with the garbage collector

  • Automatic type conversion for arguments/return value
  • Allows for an optional ident argument specifying the name of the gc handle parameter