Struct sp_wasm_interface::Pointer [−][src]
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]
const VALUE_TYPE: ValueType
[src]
fn into_value(self) -> Value
[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]
fn try_from_value(val: Value) -> Option<Self>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Pointer<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Pointer<T> where
T: Send,
T: Send,
impl<T> Sync for Pointer<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Pointer<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Pointer<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> MaybeRefUnwindSafe for T where
T: RefUnwindSafe,
[src]
T: RefUnwindSafe,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,