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 i32(i: i32) -> Value
[src]
Create an integer Value from i32
fn i64(i: i64) -> Value
[src]
Create an integer Value from i64
fn isize(i: isize) -> Value
[src]
Create a long Value from isize
fn usize(u: usize) -> Value
[src]
Create a value from usize
fn f64(d: f64) -> Value
[src]
Create a value from f64
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 i32_val(&self) -> i32
[src]
Convert an OCaml integer to i32
fn i64_val(&self) -> i64
[src]
Convert an OCaml integer to i64
fn isize_val(&self) -> isize
[src]
Convert an OCaml integer to isize
fn usize_val(&self) -> usize
[src]
Convert an OCaml integer to usize
fn f64_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 call_exn<A: ToValue>(&self, arg: A) -> Result<Value, Error>
[src]
Call a closure with a single argument, returning an exception value
fn call2_exn<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, returning an exception value
fn call3_exn<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, returning an exception value
fn call_n_exn<A: AsRef<[Value]>>(&self, args: A) -> Result<Value, Error>
[src]
Call a closure with n
arguments, returning an exception value
fn modify<V: ToValue>(&mut self, v: V)
[src]
Modify an OCaml value in place
fn is_exception_result(&self) -> bool
[src]
Determines if the current value is an exception
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