Struct ocaml_interop::BoxRoot[][src]

pub struct BoxRoot<T: 'static> { /* fields omitted */ }
Expand description

BoxRoot<T> is a container for a rooted OCaml<T> value.

Implementations

impl<T> BoxRoot<T>[src]

pub fn new(val: OCaml<'_, T>) -> BoxRoot<T>[src]

Creates a new root from an OCaml<T> value.

pub fn get<'a>(&self, cr: &'a OCamlRuntime) -> OCaml<'a, T>[src]

Gets the value stored in this root as an OCaml<T>.

pub fn keep<'tmp>(&'tmp mut self, val: OCaml<'_, T>) -> OCamlRef<'tmp, T>[src]

Roots the OCaml value val, returning an OCamlRef<T>.

Trait Implementations

impl<T> Deref for BoxRoot<T>[src]

type Target = OCamlCell<T>

The resulting type after dereferencing.

fn deref(&self) -> OCamlRef<'_, T>[src]

Dereferences the value.

impl<T> Drop for BoxRoot<T>[src]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

impl<T> ToOCaml<T> for BoxRoot<T>[src]

fn to_ocaml<'a>(&self, cr: &'a mut OCamlRuntime) -> OCaml<'a, T>[src]

Convert to OCaml value.

fn to_boxroot(&self, cr: &mut OCamlRuntime) -> BoxRoot<T>[src]

Convert to OCaml value. Return an already rooted value as BoxRoot<T>.

Auto Trait Implementations

impl<T> RefUnwindSafe for BoxRoot<T> where
    T: RefUnwindSafe

impl<T> !Send for BoxRoot<T>

impl<T> !Sync for BoxRoot<T>

impl<T> Unpin for BoxRoot<T> where
    T: Unpin

impl<T> UnwindSafe for BoxRoot<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.