[][src]Struct sp_wasm_interface::Pointer

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

Type to represent a pointer in wasm at the host.

Implementations

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
[src]

impl<T> Send for Pointer<T> where
    T: Send
[src]

impl<T> Sync for Pointer<T> where
    T: Sync
[src]

impl<T> Unpin for Pointer<T> where
    T: Unpin
[src]

impl<T> UnwindSafe for Pointer<T> where
    T: UnwindSafe
[src]

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> MaybeRefUnwindSafe for T where
    T: RefUnwindSafe
[src]

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.