[][src]Attribute Macro ocaml::func

#[func]

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

  • Wraps the function body using ocaml::body
  • Automatic type conversion for arguments/return value (including Result types)
  • Defines a bytecode function automatically for functions that take more than 5 arguments. The bytecode function for my_func would be my_func_bytecode