pub enum CastKind {
NonNull,
Unbox,
RefSubtype,
}Expand description
Dispatch hint for emit_narrowing_cast. Variants carry no Wasm-level
indices — those live in codegen’s own registries.
Variants§
NonNull
T | null → T. Codegen emits ref.as_non_null.
Unbox
Boxed primitive → unboxed primitive value. Codegen emits an
(optional) ref.as_non_null (when from_ty is nullable), a
ref.cast to the wrapper subtype ($BoxedNumber/$BoxedBoolean),
and struct.get $value.
RefSubtype
Ref-typed value → more-specific ref subtype. Codegen emits ref.cast
to the registered subtype when to_ty’s Wasm repr is tighter than
from_ty’s; emits no instruction when reps match.
Trait Implementations§
impl Copy for CastKind
impl Eq for CastKind
impl StructuralPartialEq for CastKind
Auto Trait Implementations§
impl Freeze for CastKind
impl RefUnwindSafe for CastKind
impl Send for CastKind
impl Sync for CastKind
impl Unpin for CastKind
impl UnsafeUnpin for CastKind
impl UnwindSafe for CastKind
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.