#[repr(u16)]pub enum ExtendedOpcode {
Trap = 0,
Nop = 1,
GetSp = 2,
}Expand description
An extended opcode.
Variants§
Trap = 0
Raise a trap.
Nop = 1
Do nothing.
GetSp = 2
Copy the special sp stack pointer register into an x register.
Implementations§
Source§impl ExtendedOpcode
impl ExtendedOpcode
Sourcepub fn new(bytes: u16) -> Option<Self>
pub fn new(bytes: u16) -> Option<Self>
Create a new ExtendedOpcode from the given bytes.
Returns None if bytes is not a valid extended opcode.
Sourcepub unsafe fn unchecked_new(byte: u16) -> Self
pub unsafe fn unchecked_new(byte: u16) -> Self
Like new but does not check whether bytes is a valid opcode.
§Safety
It is unsafe to pass bytes that is not a valid opcode.
Trait Implementations§
Source§impl Clone for ExtendedOpcode
impl Clone for ExtendedOpcode
Source§fn clone(&self) -> ExtendedOpcode
fn clone(&self) -> ExtendedOpcode
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExtendedOpcode
impl Debug for ExtendedOpcode
Source§impl Decode for ExtendedOpcode
Available on crate feature decode only.
impl Decode for ExtendedOpcode
Available on crate feature
decode only.Source§impl Hash for ExtendedOpcode
impl Hash for ExtendedOpcode
Source§impl Ord for ExtendedOpcode
impl Ord for ExtendedOpcode
Source§fn cmp(&self, other: &ExtendedOpcode) -> Ordering
fn cmp(&self, other: &ExtendedOpcode) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ExtendedOpcode
impl PartialEq for ExtendedOpcode
Source§impl PartialOrd for ExtendedOpcode
impl PartialOrd for ExtendedOpcode
impl Copy for ExtendedOpcode
impl Eq for ExtendedOpcode
impl StructuralPartialEq for ExtendedOpcode
Auto Trait Implementations§
impl Freeze for ExtendedOpcode
impl RefUnwindSafe for ExtendedOpcode
impl Send for ExtendedOpcode
impl Sync for ExtendedOpcode
impl Unpin for ExtendedOpcode
impl UnwindSafe for ExtendedOpcode
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