pub enum ReferenceInstruction {
Null(ReferenceType),
IsNull,
Function(FunctionIndex),
}Expand description
Instructions in this group are concerned with accessing references. These instruction produce a null value, check for a null value, or produce a reference to a given function, respectively.
See https://webassembly.github.io/spec/core/syntax/instructions.html#reference-instructions
§Examples
use wasm_ast::{ReferenceInstruction, Instruction, ReferenceType};
assert_eq!(
Instruction::Reference(ReferenceInstruction::Null(ReferenceType::External)),
ReferenceInstruction::Null(ReferenceType::External).into()
);
assert_eq!(
Instruction::Reference(ReferenceInstruction::IsNull),
ReferenceInstruction::IsNull.into()
);
assert_eq!(
Instruction::Reference(ReferenceInstruction::Function(3)),
ReferenceInstruction::Function(3).into()
);Variants§
Null(ReferenceType)
ref.null Produce a null value.
IsNull
ref.is_null Check for a null value.
Function(FunctionIndex)
ref.func funcidx Produce a reference to a given function.
Trait Implementations§
Source§impl Clone for ReferenceInstruction
impl Clone for ReferenceInstruction
Source§fn clone(&self) -> ReferenceInstruction
fn clone(&self) -> ReferenceInstruction
Returns a duplicate 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 ReferenceInstruction
impl Debug for ReferenceInstruction
Source§impl From<ReferenceInstruction> for Instruction
impl From<ReferenceInstruction> for Instruction
Source§fn from(instruction: ReferenceInstruction) -> Self
fn from(instruction: ReferenceInstruction) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ReferenceInstruction
impl PartialEq for ReferenceInstruction
impl Copy for ReferenceInstruction
impl Eq for ReferenceInstruction
impl StructuralPartialEq for ReferenceInstruction
Auto Trait Implementations§
impl Freeze for ReferenceInstruction
impl RefUnwindSafe for ReferenceInstruction
impl Send for ReferenceInstruction
impl Sync for ReferenceInstruction
impl Unpin for ReferenceInstruction
impl UnwindSafe for ReferenceInstruction
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