Trait ocaml_gen::OCamlDesc

source ·
pub trait OCamlDesc {
    // Required methods
    fn ocaml_desc(env: &Env, generics: &[&str]) -> String;
    fn unique_id() -> u128;
}
Expand description

OCamlDesc is the trait implemented by types to facilitate generation of their OCaml bindings. It is usually derived automatically via the Struct macro, or the CustomType macro for custom types.

Required Methods§

source

fn ocaml_desc(env: &Env, generics: &[&str]) -> String

describes the type in OCaml, given the current environment Env and the list of generic type parameters of the root type (the type that makes use of this type)

source

fn unique_id() -> u128

Returns a unique ID for the type. This ID will not change if concrete type parameters are used.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl OCamlDesc for &[u8]

source§

fn ocaml_desc(_env: &Env, _generics: &[&str]) -> String

source§

fn unique_id() -> u128

source§

impl OCamlDesc for bool

source§

fn ocaml_desc(_env: &Env, _generics: &[&str]) -> String

source§

fn unique_id() -> u128

source§

impl OCamlDesc for i32

source§

fn ocaml_desc(_env: &Env, _generics: &[&str]) -> String

source§

fn unique_id() -> u128

source§

impl OCamlDesc for u8

source§

fn ocaml_desc(_env: &Env, _generics: &[&str]) -> String

source§

fn unique_id() -> u128

source§

impl OCamlDesc for ()

source§

fn ocaml_desc(_env: &Env, _generics: &[&str]) -> String

source§

fn unique_id() -> u128

source§

impl OCamlDesc for usize

source§

fn ocaml_desc(_env: &Env, _generics: &[&str]) -> String

source§

fn unique_id() -> u128

source§

impl OCamlDesc for String

source§

fn ocaml_desc(_env: &Env, _generics: &[&str]) -> String

source§

fn unique_id() -> u128

source§

impl OCamlDesc for Int

source§

fn ocaml_desc(_env: &Env, _generics: &[&str]) -> String

source§

fn unique_id() -> u128

source§

impl OCamlDesc for [u8; 32]

source§

fn ocaml_desc(_env: &Env, _generics: &[&str]) -> String

source§

fn unique_id() -> u128

source§

impl<T1, T2> OCamlDesc for (T1, T2)
where T1: OCamlDesc, T2: OCamlDesc,

source§

fn ocaml_desc(env: &Env, generics: &[&str]) -> String

source§

fn unique_id() -> u128

source§

impl<T1, T2, T3> OCamlDesc for (T1, T2, T3)
where T1: OCamlDesc, T2: OCamlDesc, T3: OCamlDesc,

source§

fn ocaml_desc(env: &Env, generics: &[&str]) -> String

source§

fn unique_id() -> u128

source§

impl<T1, T2, T3, T4, T5, T6> OCamlDesc for (T1, T2, T3, T4, T5, T6)
where T1: OCamlDesc, T2: OCamlDesc, T3: OCamlDesc, T4: OCamlDesc, T5: OCamlDesc, T6: OCamlDesc,

source§

fn ocaml_desc(env: &Env, generics: &[&str]) -> String

source§

fn unique_id() -> u128

source§

impl<T1, T2, T3, T4, T5, T6, T7> OCamlDesc for (T1, T2, T3, T4, T5, T6, T7)
where T1: OCamlDesc, T2: OCamlDesc, T3: OCamlDesc, T4: OCamlDesc, T5: OCamlDesc, T6: OCamlDesc, T7: OCamlDesc,

source§

fn ocaml_desc(env: &Env, generics: &[&str]) -> String

source§

fn unique_id() -> u128

source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> OCamlDesc for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)
where T1: OCamlDesc, T2: OCamlDesc, T3: OCamlDesc, T4: OCamlDesc, T5: OCamlDesc, T6: OCamlDesc, T7: OCamlDesc, T8: OCamlDesc, T9: OCamlDesc, T10: OCamlDesc, T11: OCamlDesc, T12: OCamlDesc, T13: OCamlDesc, T14: OCamlDesc, T15: OCamlDesc,

source§

fn ocaml_desc(env: &Env, generics: &[&str]) -> String

source§

fn unique_id() -> u128

source§

impl<T> OCamlDesc for Option<T>
where T: OCamlDesc,

source§

fn ocaml_desc(env: &Env, generics: &[&str]) -> String

source§

fn unique_id() -> u128

source§

impl<T> OCamlDesc for &T
where T: OCamlDesc,

source§

fn ocaml_desc(env: &Env, generics: &[&str]) -> String

source§

fn unique_id() -> u128

source§

impl<T> OCamlDesc for Vec<T>
where T: OCamlDesc,

source§

fn ocaml_desc(env: &Env, generics: &[&str]) -> String

source§

fn unique_id() -> u128

source§

impl<T> OCamlDesc for Pointer<'_, T>
where T: OCamlDesc,

source§

fn ocaml_desc(env: &Env, generics: &[&str]) -> String

source§

fn unique_id() -> u128

source§

impl<T, E> OCamlDesc for Result<T, E>
where T: OCamlDesc,

source§

fn ocaml_desc(env: &Env, generics: &[&str]) -> String

source§

fn unique_id() -> u128

Implementors§