Struct ocaml_interop::OCaml [−][src]
pub struct OCaml<'a, T: 'a> { /* fields omitted */ }
Expand description
Representation of OCaml values.
Implementations
Obtains an OCamlRef
<T>
for this value.
Gets the raw representation for this value reference (pointer or int).
Safety
The resulting raw pointer will not be tracked, and may become invalid after any call into the OCaml runtime. Great care must be taken when working with these values.
Converts this OCaml value into a Rust value.
Meant to match Data_custom_val from mlvalues.h
Experimental
Safety
Casts to an arbitrary pointer type, take care before dereferencing
Similar to raw(), the resulting pointer can become invalid after any call into the OCaml runtime, for example allocating OCaml values or calling OCaml functions
Build an OCaml value wrapping a Rust value
The returned value will be opaque to the OCaml side, though you can provide functions using it and expose them to OCaml.
It will be dropped if it stops being referenced by the GC.
Experimental
Returns an [u8]
reference to the internal bytes of this value.
Returns a str
reference to the internal bytes of this value.
Panics
Panics if the bytes do not form a valid utf8 string.
Returns a str
reference to the internal bytes of this value.
Safety
No checks are performed to ensure that the returned value is a valid utf8 string.
Returns an [u8]
reference to the internal bytes of this value.
Returns a str
reference to the internal bytes of this value.
Panics
Panics if the bytes do not form a valid utf8 string.
Returns a str
reference to the internal bytes of this value.
Safety
No checks are performed to ensure that the returned value is a valid utf8 string.
Creates an OCaml int from an i64
without checking that it fits in an OCaml fixnum.
Safety
OCaml ints are represented as 63bits + 1bit tag, so when converting from an i64, a bit of precision is lost.
Trait Implementations
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for OCaml<'a, T> where
T: RefUnwindSafe,
impl<'a, T> UnwindSafe for OCaml<'a, T> where
T: RefUnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more