pub enum WordVal {
W32(Word32),
W64(Word64),
}Expand description
A fixed-width wrapping integer of either supported width — the single runtime carrier for
Word32/Word64 across the interpreter, VM, and wire, so the rest of the system matches on
one Word value rather than a variant per width. Binary ops require matching widths; a
width mismatch is a type error the caller reports (the ops return None).
Variants§
Implementations§
Source§impl WordVal
impl WordVal
Sourcepub const fn to_u64(self) -> u64
pub const fn to_u64(self) -> u64
The value zero-extended to u64 — the canonical scalar form for display, hashing into
other contexts, and the wire.
Sourcepub const fn from_u64(width: u32, bits: u64) -> Option<Self>
pub const fn from_u64(width: u32, bits: u64) -> Option<Self>
Build a word of the given width from the low bits of bits (32 → truncates to u32).
Trait Implementations§
impl Copy for WordVal
impl Eq for WordVal
impl StructuralPartialEq for WordVal
Auto Trait Implementations§
impl Freeze for WordVal
impl RefUnwindSafe for WordVal
impl Send for WordVal
impl Sync for WordVal
impl Unpin for WordVal
impl UnsafeUnpin for WordVal
impl UnwindSafe for WordVal
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