[][src]Struct wasmer_runtime::WasmPtr

#[repr(transparent)]
pub struct WasmPtr<T, Ty = Item> where
    T: Copy
{ /* fields omitted */ }

A pointer to a Wasm item.

Methods

impl<T, Ty> WasmPtr<T, Ty> where
    T: Copy
[src]

pub fn new(offset: u32) -> WasmPtr<T, Ty>[src]

Create a new WasmPtr at the given offset.

pub fn offset(self) -> u32[src]

Get the offset for this WasmPtr.

impl<T> WasmPtr<T, Item> where
    T: ValueType + Copy
[src]

pub fn deref(self, memory: &'a Memory) -> Option<&'a Cell<T>>[src]

Dereference this WasmPtr.

pub unsafe fn deref_mut(self, memory: &'a Memory) -> Option<&'a mut Cell<T>>[src]

Mutable dereference this WasmPtr.

impl<T> WasmPtr<T, Array> where
    T: ValueType + Copy
[src]

pub fn deref(
    self,
    memory: &'a Memory,
    index: u32,
    length: u32
) -> Option<&'a [Cell<T>]>
[src]

Dereference this WasmPtr.

pub unsafe fn deref_mut(
    self,
    memory: &'a Memory,
    index: u32,
    length: u32
) -> Option<&'a mut [Cell<T>]>
[src]

Mutable dereference this WasmPtr.

pub fn get_utf8_string(
    self,
    memory: &'a Memory,
    str_len: u32
) -> Option<&'a str>
[src]

Get a UTF-8 string representation of this WasmPtr with the given length.

pub fn get_utf8_string_with_nul(self, memory: &'a Memory) -> Option<&'a str>[src]

Get a UTF-8 string representation of this WasmPtr, where the string is nul-terminated. Note that this does not account for UTF-8 strings that contain nul themselves, [get_utf8_string] has to be used for those.

Trait Implementations

impl<T, Ty> Clone for WasmPtr<T, Ty> where
    T: Copy
[src]

impl<T, Ty> Copy for WasmPtr<T, Ty> where
    T: Copy
[src]

impl<T, Ty> Debug for WasmPtr<T, Ty> where
    T: Copy
[src]

impl<T, Ty> Eq for WasmPtr<T, Ty> where
    T: Copy
[src]

impl<T, Ty> PartialEq<WasmPtr<T, Ty>> for WasmPtr<T, Ty> where
    T: Copy
[src]

impl<T, Ty> ValueType for WasmPtr<T, Ty> where
    T: Copy
[src]

impl<T, Ty> WasmExternType for WasmPtr<T, Ty> where
    T: Copy
[src]

type Native = i32

Native wasm type for this WasmExternType.

Auto Trait Implementations

impl<T, Ty> RefUnwindSafe for WasmPtr<T, Ty> where
    T: RefUnwindSafe,
    Ty: RefUnwindSafe

impl<T, Ty> Send for WasmPtr<T, Ty> where
    T: Send,
    Ty: Send

impl<T, Ty> Sync for WasmPtr<T, Ty> where
    T: Sync,
    Ty: Sync

impl<T, Ty> Unpin for WasmPtr<T, Ty> where
    T: Unpin,
    Ty: Unpin

impl<T, Ty> UnwindSafe for WasmPtr<T, Ty> where
    T: UnwindSafe,
    Ty: UnwindSafe

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, U> Into<U> for T where
    U: From<T>, 
[src]

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

type Owned = T

The resulting type after obtaining ownership.

impl<Rets> TrapEarly<Rets> for Rets where
    Rets: WasmTypeList
[src]

type Error = Infallible

The error type for this trait.

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<A> WasmTypeList for A where
    A: WasmExternType
[src]

type CStruct = S1<A>

CStruct type.

type RetArray = [u64; 1]

Array of return values.