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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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