[][src]Enum wasmer::ExternRef

pub enum ExternRef {
    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.

Other(OtherRef)

A reference to data located outside.

Implementations

impl ExternRef[src]

pub fn new(data: Box<dyn Any + 'static, Global>) -> ExternRef[src]

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

pub fn null() -> ExternRef[src]

Creates a Null reference.

pub fn data(&self) -> Ref<'_, Box<dyn Any + 'static, Global>>[src]

Returns the data stored in the reference if available.

Panics

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

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

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

pub fn host_info(
    &self
) -> Option<RefMut<'_, Box<dyn HostInfo + 'static, Global>>>
[src]

Returns a mutable reference to the host information if available.

Panics

Panics if ExternRef is already borrowed or ExternRef is Null.

pub fn set_host_info(&self, info: Option<Box<dyn HostInfo + 'static, Global>>)[src]

Sets the host information for an ExternRef.

Panics

Panics if ExternRef is already borrowed or ExternRef is Null.

Trait Implementations

impl Clone for ExternRef[src]

impl Debug for ExternRef[src]

impl Eq for ExternRef[src]

impl Hash for ExternRef[src]

impl PartialEq<ExternRef> for ExternRef[src]

Auto Trait Implementations

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<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

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

impl<T> Instrument for T[src]

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

impl<T> Pointable for T

type Init = T

The type for initializers.

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,