Struct ocaml::value::Value [−][src]
pub struct Value(pub Value);
Value wraps the native OCaml value
type
Methods
impl Value
[src]
impl Value
pub fn alloc(n: usize, tag: Tag) -> Value
[src]
pub fn alloc(n: usize, tag: Tag) -> Value
Allocate a new value with the given size and tag
pub fn alloc_small(n: usize, tag: Tag) -> Value
[src]
pub fn alloc_small(n: usize, tag: Tag) -> Value
Allocate a new small value with the given size and tag
pub fn alloc_custom<T>(
value: *mut T,
finalizer: extern "C" fn(_: Value)
) -> Value
[src]
pub fn alloc_custom<T>(
value: *mut T,
finalizer: extern "C" fn(_: Value)
) -> Value
Allocate a new value with a custom finalizer
pub fn set_custom<T>(&mut self, value: *mut T)
[src]
pub fn set_custom<T>(&mut self, value: *mut T)
pub fn new(v: Value) -> Value
[src]
pub fn new(v: Value) -> Value
Create a new Value from an existing OCaml value
pub fn register_global_root(&self)
[src]
pub fn register_global_root(&self)
See caml_register_global_root
pub fn remove_global_root(&self)
[src]
pub fn remove_global_root(&self)
Set caml_remove_global_root
pub fn value(&self) -> Value
[src]
pub fn value(&self) -> Value
Get the underlying OCaml value
pub fn tag(&self) -> Tag
[src]
pub fn tag(&self) -> Tag
Get the tag for the underlying OCaml value
pub fn bool(b: bool) -> Value
[src]
pub fn bool(b: bool) -> Value
Convert a boolean to OCaml value
pub fn some<V: ToValue>(v: V) -> Value
[src]
pub fn some<V: ToValue>(v: V) -> Value
OCaml Some value
pub fn none() -> Value
[src]
pub fn none() -> Value
OCaml None value
pub fn variant<V: ToValue>(tag: u8, value: Option<V>) -> Value
[src]
pub fn variant<V: ToValue>(tag: u8, value: Option<V>) -> Value
Create a variant value
pub fn ptr<T>(p: *const T) -> Value
[src]
pub fn ptr<T>(p: *const T) -> Value
Create a new opaque pointer Value
pub fn i32(i: i32) -> Value
[src]
pub fn i32(i: i32) -> Value
Create an integer Value from i32
pub fn i64(i: i64) -> Value
[src]
pub fn i64(i: i64) -> Value
Create an integer Value from i64
pub fn int64(i: i64) -> Value
[src]
pub fn int64(i: i64) -> Value
Create an OCaml int64 from i64
pub fn int32(i: i32) -> Value
[src]
pub fn int32(i: i32) -> Value
Create an OCaml int32 from i32
pub fn nativeint(i: isize) -> Value
[src]
pub fn nativeint(i: isize) -> Value
Create an OCaml native int from isize
pub fn isize(i: isize) -> Value
[src]
pub fn isize(i: isize) -> Value
Create a long Value from isize
pub fn usize(u: usize) -> Value
[src]
pub fn usize(u: usize) -> Value
Create a value from usize
pub fn f64(d: f64) -> Value
[src]
pub fn f64(d: f64) -> Value
Create a value from f64
pub fn is_block(&self) -> bool
[src]
pub fn is_block(&self) -> bool
Check if a Value is an integer or block, returning true if the underlying value is a block
pub fn is_long(&self) -> bool
[src]
pub fn is_long(&self) -> bool
Check if a Value is an integer or block, returning true if the underlying value is an integer
pub fn field(&self, i: Size) -> Value
[src]
pub fn field(&self, i: Size) -> Value
Get index of underlying OCaml block value
pub fn store_field<V: ToValue>(&mut self, i: Size, val: V)
[src]
pub fn store_field<V: ToValue>(&mut self, i: Size, val: V)
Set index of underlying OCaml block value
pub fn i32_val(&self) -> i32
[src]
pub fn i32_val(&self) -> i32
Convert an OCaml integer to i32
pub fn i64_val(&self) -> i64
[src]
pub fn i64_val(&self) -> i64
Convert an OCaml integer to i64
pub fn isize_val(&self) -> isize
[src]
pub fn isize_val(&self) -> isize
Convert an OCaml integer to isize
pub fn usize_val(&self) -> usize
[src]
pub fn usize_val(&self) -> usize
Convert an OCaml integer to usize
pub fn f64_val(&self) -> f64
[src]
pub fn f64_val(&self) -> f64
Convert an OCaml float to f64
pub fn int32_val(&self) -> i32
[src]
pub fn int32_val(&self) -> i32
Convert an OCaml int32 to i32
pub fn int64_val(&self) -> i64
[src]
pub fn int64_val(&self) -> i64
Convert an OCaml int64 to i64
pub fn nativeint_val(&self) -> isize
[src]
pub fn nativeint_val(&self) -> isize
Convert an OCaml integer to isize
pub fn custom_ptr_val<T>(&self) -> *const T
[src]
pub fn custom_ptr_val<T>(&self) -> *const T
Get pointer to data stored in an OCaml custom value
pub fn custom_ptr_val_mut<T>(&self) -> *mut T
[src]
pub fn custom_ptr_val_mut<T>(&self) -> *mut T
Get mutable pointer to data stored in an OCaml custom value
pub fn ptr_val<T>(&self) -> *const T
[src]
pub fn ptr_val<T>(&self) -> *const T
Get pointer to data stored in an opaque value
pub fn mut_ptr_val<T>(&self) -> *mut T
[src]
pub fn mut_ptr_val<T>(&self) -> *mut T
Get mutable pointer to data stored in an opaque value
pub fn call<A: ToValue>(&self, arg: A) -> Result<Value, Error>
[src]
pub fn call<A: ToValue>(&self, arg: A) -> Result<Value, Error>
Call a closure with a single argument
pub fn call2<A: ToValue, B: ToValue>(
&self,
arg1: A,
arg2: B
) -> Result<Value, Error>
[src]
pub fn call2<A: ToValue, B: ToValue>(
&self,
arg1: A,
arg2: B
) -> Result<Value, Error>
Call a closure with two arguments
pub fn call3<A: ToValue, B: ToValue, C: ToValue>(
&self,
arg1: A,
arg2: B,
arg3: C
) -> Result<Value, Error>
[src]
pub fn call3<A: ToValue, B: ToValue, C: ToValue>(
&self,
arg1: A,
arg2: B,
arg3: C
) -> Result<Value, Error>
Call a closure with three arguments
pub fn call_n<A: AsRef<[Value]>>(&self, args: A) -> Result<Value, Error>
[src]
pub fn call_n<A: AsRef<[Value]>>(&self, args: A) -> Result<Value, Error>
Call a closure with n
arguments
pub fn call_exn<A: ToValue>(&self, arg: A) -> Result<Value, Error>
[src]
pub fn call_exn<A: ToValue>(&self, arg: A) -> Result<Value, Error>
Call a closure with a single argument, returning an exception value
pub fn call2_exn<A: ToValue, B: ToValue>(
&self,
arg1: A,
arg2: B
) -> Result<Value, Error>
[src]
pub fn call2_exn<A: ToValue, B: ToValue>(
&self,
arg1: A,
arg2: B
) -> Result<Value, Error>
Call a closure with two arguments, returning an exception value
pub fn call3_exn<A: ToValue, B: ToValue, C: ToValue>(
&self,
arg1: A,
arg2: B,
arg3: C
) -> Result<Value, Error>
[src]
pub fn call3_exn<A: ToValue, B: ToValue, C: ToValue>(
&self,
arg1: A,
arg2: B,
arg3: C
) -> Result<Value, Error>
Call a closure with three arguments, returning an exception value
pub fn call_n_exn<A: AsRef<[Value]>>(&self, args: A) -> Result<Value, Error>
[src]
pub fn call_n_exn<A: AsRef<[Value]>>(&self, args: A) -> Result<Value, Error>
Call a closure with n
arguments, returning an exception value
pub fn modify<V: ToValue>(&mut self, v: V)
[src]
pub fn modify<V: ToValue>(&mut self, v: V)
Modify an OCaml value in place
pub fn is_exception_result(&self) -> bool
[src]
pub fn is_exception_result(&self) -> bool
Determines if the current value is an exception
pub fn method<S: AsRef<str>>(&self, name: S) -> Option<Value>
[src]
pub fn method<S: AsRef<str>>(&self, name: S) -> Option<Value>
Get object method
Trait Implementations
impl From<Tuple> for Value
[src]
impl From<Tuple> for Value
impl From<Array> for Value
[src]
impl From<Array> for Value
impl From<Value> for Array
[src]
impl From<Value> for Array
impl From<List> for Value
[src]
impl From<List> for Value
impl From<Value> for List
[src]
impl From<Value> for List
impl From<Str> for Value
[src]
impl From<Str> for Value
impl From<Value> for Str
[src]
impl From<Value> for Str
impl<T: BigarrayKind> From<Array1<T>> for Value
[src]
impl<T: BigarrayKind> From<Array1<T>> for Value
impl<T: BigarrayKind> From<Value> for Array1<T>
[src]
impl<T: BigarrayKind> From<Value> for Array1<T>
impl Debug for Value
[src]
impl Debug for Value
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Value
[src]
impl Clone for Value
fn clone(&self) -> Value
[src]
fn clone(&self) -> Value
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl From<Value> for Value
[src]
impl From<Value> for Value
impl ToValue for Value
[src]
impl ToValue for Value
impl FromValue for Value
[src]
impl FromValue for Value
fn from_value(v: Value) -> Value
[src]
fn from_value(v: Value) -> Value