#[repr(u16)]pub enum ExtendedOpcode {
Trap = 0,
Nop = 1,
CallIndirectHost = 2,
}
Expand description
An extended opcode.
Variants§
Trap = 0
Raise a trap.
Nop = 1
Do nothing.
CallIndirectHost = 2
A special opcode to use an indirect function call to reenter the host from the interpreter.
This is used to implement host intrinsics such as memory.grow
for example where that needs to reenter the host from the
interpreter.
The sig
immediate here is the Nth signature in the
for_each_host_signature!
macro below. The 0th “argument”, in
register x0, is the function pointer that’s being called and all
further arguments follow after that in registers.
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