pub enum ParametricInstruction {
Drop,
Select(Option<Vec<ValueType>>),
}Expand description
Instructions in this group can operate on operands of any value type.
See https://webassembly.github.io/spec/core/syntax/instructions.html#parametric-instructions
§Examples
use wasm_ast::{ParametricInstruction, Instruction, ValueType};
assert_eq!(
Instruction::Parametric(ParametricInstruction::Drop),
ParametricInstruction::Drop.into()
);
assert_eq!(
Instruction::Parametric(ParametricInstruction::Select(Some(vec![ValueType::I32]))),
ParametricInstruction::Select(Some(vec![ValueType::I32])).into()
);
assert_eq!(
Instruction::Parametric(ParametricInstruction::Select(Some(vec![]))),
ParametricInstruction::Select(Some(vec![])).into()
);
assert_eq!(
Instruction::Parametric(ParametricInstruction::Select(None)),
ParametricInstruction::Select(None).into()
);Variants§
Drop
The 𝖽𝗋𝗈𝗉 instruction simply throws away a single operand.
Select(Option<Vec<ValueType>>)
The 𝗌𝖾𝗅𝖾𝖼𝗍 instruction selects one of its first two operands based on whether its third operand is zero or not. It may include a value type determining the type of these operands. If missing, the operands must be of numeric type.
Trait Implementations§
Source§impl Clone for ParametricInstruction
impl Clone for ParametricInstruction
Source§fn clone(&self) -> ParametricInstruction
fn clone(&self) -> ParametricInstruction
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 ParametricInstruction
impl Debug for ParametricInstruction
Source§impl From<ParametricInstruction> for Instruction
impl From<ParametricInstruction> for Instruction
Source§fn from(instruction: ParametricInstruction) -> Self
fn from(instruction: ParametricInstruction) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ParametricInstruction
impl PartialEq for ParametricInstruction
impl Eq for ParametricInstruction
impl StructuralPartialEq for ParametricInstruction
Auto Trait Implementations§
impl Freeze for ParametricInstruction
impl RefUnwindSafe for ParametricInstruction
impl Send for ParametricInstruction
impl Sync for ParametricInstruction
impl Unpin for ParametricInstruction
impl UnwindSafe for ParametricInstruction
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