Struct RefType
pub struct RefType { /* private fields */ }
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§
§impl RefType
impl RefType
pub const NULLEXTERNREF: RefType = _
pub const NULLEXTERNREF: RefType = _
The nullexternref
type, aka (ref null noextern)
.
pub const NULLFUNCREF: RefType = _
pub const NULLFUNCREF: RefType = _
The nullfuncref
type, aka (ref null nofunc)
.
pub fn is_nullable(&self) -> bool
pub fn is_nullable(&self) -> bool
Can this type of reference be null?
Trait Implementations§
§impl From<RefType> for StorageType
impl From<RefType> for StorageType
§fn from(r: RefType) -> StorageType
fn from(r: RefType) -> StorageType
Converts to this type from the input type.
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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