[−][src]Macro ocaml_interop::impl_from_ocaml_record
Implements FromOCaml
for mapping an OCaml record into a Rust record.
It is important that the order remains the same as in the OCaml type declaration.
Examples
struct MyStruct { int_field: i64, string_field: String, } // Assuming an OCaml record declaration like: // // type my_struct = { // int_field: int; // string_field: string; // } // // NOTE: What is important is the order of the fields, not their names. impl_from_ocaml_record! { // Optionally, if Rust and OCaml types don't match: // OCamlType => RustType { ... } MyStruct { int_field: OCamlInt, string_field: String, } }