Struct sp_wasm_interface::Pointer[][src]

pub struct Pointer<T: PointerType> { /* fields omitted */ }

Type to represent a pointer in wasm at the host.


impl<T: PointerType> Pointer<T>[src]

pub fn new(ptr: u32) -> Self[src]

Create a new instance of Self.

pub fn offset(self, offset: u32) -> Option<Self>[src]

Calculate the offset from this pointer.

offset is in units of T. So, 3 means 3 * mem::size_of::<T>() as offset to the pointer.

Returns an Option to respect that the pointer could probably overflow.

pub fn null() -> Self[src]

Create a null pointer.

pub fn cast<R: PointerType>(self) -> Pointer<R>[src]

Cast this pointer of type T to a pointer of type R.

Trait Implementations

impl<T: Clone + PointerType> Clone for Pointer<T>[src]

impl<T: Copy + PointerType> Copy for Pointer<T>[src]

impl<T: Debug + PointerType> Debug for Pointer<T>[src]

impl<T: Eq + PointerType> Eq for Pointer<T>[src]

impl<T: PointerType> From<u32> for Pointer<T>[src]

impl<T: PointerType> IntoValue for Pointer<T>[src]

impl<T: PartialEq + PointerType> PartialEq<Pointer<T>> for Pointer<T>[src]

impl<T: PointerType> StructuralEq for Pointer<T>[src]

impl<T: PointerType> StructuralPartialEq for Pointer<T>[src]

impl<T: PointerType> TryFromValue for Pointer<T>[src]

Auto Trait Implementations

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

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

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

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

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

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

impl<T> MaybeRefUnwindSafe for T where
    T: RefUnwindSafe

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.