pub struct RefType { /* private fields */ }
Available on crate feature
runtime
only.Expand description
Opaque references to data in the Wasm heap or to host data.
§Subtyping and Equality
RefType
does not implement Eq
, because reference types have a subtyping
relationship, and so 99.99% of the time you actually want to check whether
one type matches (i.e. is a subtype of) another type. You can use the
RefType::matches
and Ref::matches_ty
methods
to perform these types of checks. If, however, you are in that 0.01%
scenario where you need to check precise equality between types, you can use
the RefType::eq
method.
Implementations§
Source§impl RefType
impl RefType
Sourcepub const NULLEXTERNREF: Self = _
pub const NULLEXTERNREF: Self = _
The nullexternref
type, aka (ref null noextern)
.
Sourcepub const NULLFUNCREF: Self = _
pub const NULLFUNCREF: Self = _
The nullfuncref
type, aka (ref null nofunc)
.
Sourcepub fn is_nullable(&self) -> bool
pub fn is_nullable(&self) -> bool
Can this type of reference be null?
Trait Implementations§
Source§impl From<RefType> for StorageType
impl From<RefType> for StorageType
Auto Trait Implementations§
impl Freeze for RefType
impl !RefUnwindSafe for RefType
impl Send for RefType
impl Sync for RefType
impl Unpin for RefType
impl !UnwindSafe for RefType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more