[][src]Enum wasmtime::AnyRef

pub enum AnyRef {
    Null,
    Ref(InternalRef),
    Other(OtherRef),
}

Represents an opaque reference to any data within WebAssembly.

Variants

Null

A reference to no data.

Ref(InternalRef)

A reference to data stored internally in wasmtime.

Other(OtherRef)

A reference to data located outside of wasmtime.

Methods

impl AnyRef[src]

pub fn new(data: Box<dyn Any>) -> Self[src]

Creates a new instance of AnyRef from Box<dyn Any>.

pub fn null() -> Self[src]

Creates a Null reference.

pub fn data(&self) -> Ref<Box<dyn Any>>[src]

Returns the data stored in the reference if available.

Panics

Panics if the variant isn't AnyRef::Other.

pub fn ptr_eq(&self, other: &AnyRef) -> bool[src]

Returns true if the two AnyRef<T>'s point to the same value (not just values that compare as equal).

pub fn host_info(&self) -> Option<RefMut<Box<dyn Any>>>[src]

Returns a mutable reference to the host information if available.

Panics

Panics if AnyRef is already borrowed or AnyRef is Null.

pub fn set_host_info(&self, info: Option<Box<dyn Any>>)[src]

Sets the host information for an AnyRef.

Panics

Panics if AnyRef is already borrowed or AnyRef is Null.

Trait Implementations

impl Clone for AnyRef[src]

impl Debug for AnyRef[src]

impl From<AnyRef> for Val[src]

Auto Trait Implementations

impl !RefUnwindSafe for AnyRef

impl !Send for AnyRef

impl !Sync for AnyRef

impl Unpin for AnyRef

impl !UnwindSafe for AnyRef

Blanket Implementations

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

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

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

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.