Struct Pointer

Source
pub struct Pointer<T: WasmType> { /* private fields */ }

Implementations§

Source§

impl<T: WasmType> Pointer<T>

Source

pub fn copy(&mut self, val: &T)

Source

pub fn set(&mut self, val: T)

Source

pub fn value(&self) -> T::Value

Source

pub fn next(self) -> Option<Self>

Source

pub fn u8_pointer(self) -> Pointer<u8>

Source§

impl Pointer<u8>

Source

pub fn copy_slice(self, slice: &[u8]) -> Result<Option<Self>, Trap>

Source

pub fn mut_slice<'a>(&'a self, n: usize) -> &'a mut [u8]

Source

pub fn cast<T: WasmType>(self) -> Option<Pointer<T>>

Source

pub fn set_cast<T: WasmType>(self, val: T) -> Result<Option<Self>, Trap>

Trait Implementations§

Source§

impl<T: WasmType> Debug for Pointer<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: WasmType> FromWasm for Pointer<T>

Source§

type From = u32

Source§

type State = ()

Source§

fn from( _state: &mut Self::State, executor: &impl Executor, wasm_u32: u32, ) -> Result<Self, Trap>

Auto Trait Implementations§

§

impl<T> Freeze for Pointer<T>

§

impl<T> RefUnwindSafe for Pointer<T>
where T: RefUnwindSafe,

§

impl<T> Send for Pointer<T>
where T: Send,

§

impl<T> Sync for Pointer<T>
where T: Sync,

§

impl<T> Unpin for Pointer<T>
where T: Unpin,

§

impl<T> UnwindSafe for Pointer<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.