pub struct RegId(/* private fields */);
Expand description
Represents a 6-bit register ID, guaranteed to be masked by construction.
Implementations§
Source§impl RegId
impl RegId
Sourcepub const HP: Self
pub const HP: Self
Heap pointer. Memory address below the current bottom of the heap (points to free memory).
Sourcepub const SP: Self
pub const SP: Self
Stack pointer. Memory address on top of current writable stack area (points to free memory).
Sourcepub const SSP: Self
pub const SSP: Self
Stack start pointer. Memory address of bottom of current writable stack area.
Source§impl RegId
impl RegId
Sourcepub fn new_checked(u: u8) -> Option<RegId>
pub fn new_checked(u: u8) -> Option<RegId>
Construct a register ID from the given value.
Returns None
if the value is outside the 6-bit value range.
Source§impl RegId
impl RegId
Sourcepub fn hp() -> Self
pub fn hp() -> Self
Heap pointer. Memory address below the current bottom of the heap (points to free memory).
Sourcepub fn sp() -> Self
pub fn sp() -> Self
Stack pointer. Memory address on top of current writable stack area (points to free memory).
Sourcepub fn spp() -> Self
pub fn spp() -> Self
Stack start pointer. Memory address of bottom of current writable stack area.
Sourcepub fn new_typescript(u: u8) -> Self
pub fn new_typescript(u: u8) -> Self
Construct a register ID from the given value.
The given value will be masked to 6 bits.
Sourcepub fn to_u8_typescript(self) -> u8
pub fn to_u8_typescript(self) -> u8
A const alternative to the Into<u8>
implementation.
Trait Implementations§
Source§impl FromWasmAbi for RegId
impl FromWasmAbi for RegId
Source§impl IntoWasmAbi for RegId
impl IntoWasmAbi for RegId
Source§impl LongRefFromWasmAbi for RegId
impl LongRefFromWasmAbi for RegId
Source§impl OptionFromWasmAbi for RegId
impl OptionFromWasmAbi for RegId
Source§impl OptionIntoWasmAbi for RegId
impl OptionIntoWasmAbi for RegId
Source§impl Ord for RegId
impl Ord for RegId
Source§impl PartialOrd for RegId
impl PartialOrd for RegId
Source§impl RefFromWasmAbi for RegId
impl RefFromWasmAbi for RegId
Source§impl RefMutFromWasmAbi for RegId
impl RefMutFromWasmAbi for RegId
Source§impl TryFromJsValue for RegId
impl TryFromJsValue for RegId
Source§impl VectorFromWasmAbi for RegId
impl VectorFromWasmAbi for RegId
Source§impl VectorIntoWasmAbi for RegId
impl VectorIntoWasmAbi for RegId
impl Copy for RegId
impl Eq for RegId
impl StructuralPartialEq for RegId
impl SupportsConstructor for RegId
impl SupportsInstanceProperty for RegId
impl SupportsStaticProperty for RegId
Auto Trait Implementations§
impl Freeze for RegId
impl RefUnwindSafe for RegId
impl Send for RegId
impl Sync for RegId
impl Unpin for RegId
impl UnwindSafe for RegId
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
IntoWasmAbi::Abi
Source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.