pub enum TableInstruction {
Get(TableIndex),
Set(TableIndex),
Size(TableIndex),
Grow(TableIndex),
Fill(TableIndex),
Copy(TableIndex, TableIndex),
Init(ElementIndex, TableIndex),
ElementDrop(ElementIndex),
}Expand description
Instructions in this group are concerned with tables table. An additional instruction that accesses a table is the control instruction πΌπΊπ π _πππ½πππΎπΌπ.
See https://webassembly.github.io/spec/core/syntax/instructions.html#table-instructions
Β§Examples
use wasm_ast::{TableInstruction, Instruction};
assert_eq!(
Instruction::Table(TableInstruction::Get(1)),
TableInstruction::Get(1).into()
);
assert_eq!(
Instruction::Table(TableInstruction::Set(1)),
TableInstruction::Set(1).into()
);
assert_eq!(
Instruction::Table(TableInstruction::Size(1)),
TableInstruction::Size(1).into()
);
assert_eq!(
Instruction::Table(TableInstruction::Grow(1)),
TableInstruction::Grow(1).into()
);
assert_eq!(
Instruction::Table(TableInstruction::Fill(1)),
TableInstruction::Fill(1).into()
);
assert_eq!(
Instruction::Table(TableInstruction::Copy(0, 1)),
TableInstruction::Copy(0, 1).into()
);
assert_eq!(
Instruction::Table(TableInstruction::Init(0, 0)),
TableInstruction::Init(0, 0).into()
);
assert_eq!(
Instruction::Table(TableInstruction::ElementDrop(0)),
TableInstruction::ElementDrop(0).into()
);VariantsΒ§
Get(TableIndex)
The ππΊπ»π πΎ.ππΎπ instruction loads an element in a table.
Set(TableIndex)
The ππΊπ»π πΎ.ππΎπ instruction stores an element in a table.
Size(TableIndex)
The ππΊπ»π πΎ.ππππΎ instruction returns the current size of a table.
Grow(TableIndex)
The ππΊπ»π πΎ.ππππ instruction grows table by a given delta and returns the previous size, or β1 if enough space cannot be allocated. It also takes an initialization value for the newly allocated entries.
Fill(TableIndex)
The ππΊπ»π πΎ.πΏππ π instruction sets all entries in a range to a given value.
Copy(TableIndex, TableIndex)
The ππΊπ»π πΎ.πΌπππ instruction copies elements from a source table region to a possibly overlapping destination region; the first index denotes the destination.
Init(ElementIndex, TableIndex)
The ππΊπ»π πΎ.ππππ instruction copies elements from a passive element segment into a table.
ElementDrop(ElementIndex)
The πΎπ πΎπ.π½πππ instruction prevents further use of a passive element segment. This instruction is intended to be used as an optimization hint. After an element segment is dropped its elements can no longer be retrieved, so the memory used by this segment may be freed.
Trait ImplementationsΒ§
SourceΒ§impl Clone for TableInstruction
impl Clone for TableInstruction
SourceΒ§fn clone(&self) -> TableInstruction
fn clone(&self) -> TableInstruction
1.0.0 Β· SourceΒ§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more