[][src]Macro ocaml_interop::ocaml_alloc_variant

macro_rules! ocaml_alloc_variant {
    ($self:ident => {
        $($($tag:ident)::+ $(($($slot_name:ident: $slot_typ:ty),+ $(,)?))? $(,)?),+
    }) => { ... };
}

Allocates an OCaml variant, mapped from a Rust enum.

The conversion is exhaustive, and requires that every enum case is handled.

It is important that the order remains the same as in the OCaml type declaration.

Examples

TODO