Struct ocaml::value::Value
[−]
[src]
pub struct Value(pub Value);
Value wraps the native OCaml value
type
Methods
impl Value
[src]
fn alloc(n: usize, tag: Tag) -> Value
[src]
Allocate a new value with the given size and tag
fn alloc_small(n: usize, tag: Tag) -> Value
[src]
Allocate a new small value with the given size and tag
fn new(v: Value) -> Value
[src]
Create a new Value from an existing OCaml value
fn value(&self) -> Value
[src]
Get the underlying OCaml value
fn tag(&self) -> Tag
[src]
Get the tag for the underlying OCaml value
fn ptr<T>(p: *const T) -> Value
[src]
Create a new opaque pointer Value
fn int(i: i32) -> Value
[src]
Create an integer Value
fn long(i: i64) -> Value
[src]
Create a long Value
fn double(d: f64) -> Value
[src]
Create a double Value
fn is_block(&self) -> bool
[src]
Check if a Value is an integer or block, returning true if the underlying value is a block
fn is_long(&self) -> bool
[src]
Check if a Value is an integer or block, returning true if the underlying value is an integer
fn field(&self, i: Size) -> Value
[src]
Get index of underlying OCaml block value
fn store_field<V: ToValue>(&mut self, i: Size, val: V)
[src]
Set index of underlying OCaml block value
fn int_val(&self) -> i32
[src]
Convert an OCaml integer to i32
fn long_val(&self) -> i64
[src]
Convert an OCaml integer to i64
fn double_val(&self) -> f64
[src]
Convert an OCaml float to f64
fn ptr_val<T>(&self) -> *const T
[src]
Get a pointer stored in an opaque value
fn call<A: ToValue>(&self, arg: A) -> Result<Value, Error>
[src]
Call a closure with a single argument
fn call2<A: ToValue, B: ToValue>(
&self,
arg1: A,
arg2: B
) -> Result<Value, Error>
[src]
&self,
arg1: A,
arg2: B
) -> Result<Value, Error>
Call a closure with two arguments
fn call3<A: ToValue, B: ToValue, C: ToValue>(
&self,
arg1: A,
arg2: B,
arg3: C
) -> Result<Value, Error>
[src]
&self,
arg1: A,
arg2: B,
arg3: C
) -> Result<Value, Error>
Call a closure with three arguments
fn call_n<A: AsRef<[Value]>>(&self, args: A) -> Result<Value, Error>
[src]
Call a closure with n
arguments
fn modify<V: ToValue>(&mut self, v: V)
[src]
Trait Implementations
impl From<Tuple> for Value
[src]
impl From<Array> for Value
[src]
impl From<List> for Value
[src]
impl From<Str> for Value
[src]
impl Debug for Value
[src]
impl Clone for Value
[src]
fn clone(&self) -> Value
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more