[−][src]Macro ocaml_interop::ocaml_unpack_record
Unpacks an OCaml record into a Rust record
It is important that the order of the fields 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. let ocaml_struct = make_mystruct(cr, &OCaml::unit()); let my_struct = ocaml_unpack_record! { // value => RustConstructor { field: OCamlType, ... } ocaml_struct => MyStruct { int_field: OCamlInt, string_field: String, } }; // ...