[−][src]Struct walrus::BlockBuilder
A builder returned by block-construction methods to build up block expressions over time.
Methods
impl<'_> BlockBuilder<'_>
[src]
pub fn expr(&mut self, expr: ExprId)
[src]
Pushes a new expression to be executed in the block we're building
pub fn id(&self) -> BlockId
[src]
Returns the id of the block that we're building
Methods from Deref<Target = FunctionBuilder>
pub fn block<'a>(
&'a mut self,
params: Box<[ValType]>,
results: Box<[ValType]>
) -> BlockBuilder<'a>
[src]
&'a mut self,
params: Box<[ValType]>,
results: Box<[ValType]>
) -> BlockBuilder<'a>
Create a Block
node with the kind of Block
.
Note that instructions aren't passed here, but rather added to the
returned BlockBuilder
via the expr
method.
Examples
use walrus::FunctionBuilder; let mut builder = FunctionBuilder::new(); let block = { let mut block = builder.block(Box::new([]), Box::new([])); let id = block.id(); let br = block.br(id, Box::new([])); block.expr(br); id }; // when `block` is `Drop`'d it'll fill in the node's expressions // ...
pub fn loop_<'a>(&'a mut self, results: Box<[ValType]>) -> BlockBuilder<'a>
[src]
Create a Block
node with the kind of Loop
pub fn if_else_block<'a>(
&'a mut self,
params: Box<[ValType]>,
results: Box<[ValType]>
) -> BlockBuilder<'a>
[src]
&'a mut self,
params: Box<[ValType]>,
results: Box<[ValType]>
) -> BlockBuilder<'a>
Create a Block
node with the kind of IfElse
pub fn i32_const(&mut self, val: i32) -> ExprId
[src]
Creates an i32.const
instruction for the specified value
pub fn i64_const(&mut self, val: i64) -> ExprId
[src]
Creates an i64.const
instruction for the specified value
pub fn f32_const(&mut self, val: f32) -> ExprId
[src]
Creates an f32.const
instruction for the specified value
pub fn f64_const(&mut self, val: f64) -> ExprId
[src]
Creates an f64.const
instruction for the specified value
pub fn call(&mut self, func: FunctionId, args: Box<[ExprId]>) -> ExprId
[src]
pub fn call_indirect(
&mut self,
ty: TypeId,
table: TableId,
func: ExprId,
args: Box<[ExprId]>
) -> ExprId
[src]
&mut self,
ty: TypeId,
table: TableId,
func: ExprId,
args: Box<[ExprId]>
) -> ExprId
pub fn local_get(&mut self, local: LocalId) -> ExprId
[src]
pub fn local_set(&mut self, local: LocalId, value: ExprId) -> ExprId
[src]
pub fn local_tee(&mut self, local: LocalId, value: ExprId) -> ExprId
[src]
pub fn global_get(&mut self, global: GlobalId) -> ExprId
[src]
pub fn global_set(&mut self, global: GlobalId, value: ExprId) -> ExprId
[src]
pub fn const_(&mut self, value: Value) -> ExprId
[src]
pub fn binop(&mut self, op: BinaryOp, lhs: ExprId, rhs: ExprId) -> ExprId
[src]
pub fn unop(&mut self, op: UnaryOp, expr: ExprId) -> ExprId
[src]
pub fn select(
&mut self,
condition: ExprId,
consequent: ExprId,
alternative: ExprId
) -> ExprId
[src]
&mut self,
condition: ExprId,
consequent: ExprId,
alternative: ExprId
) -> ExprId
pub fn unreachable(&mut self) -> ExprId
[src]
pub fn br(&mut self, block: BlockId, args: Box<[ExprId]>) -> ExprId
[src]
pub fn br_if(
&mut self,
condition: ExprId,
block: BlockId,
args: Box<[ExprId]>
) -> ExprId
[src]
&mut self,
condition: ExprId,
block: BlockId,
args: Box<[ExprId]>
) -> ExprId
pub fn if_else(
&mut self,
condition: ExprId,
consequent: BlockId,
alternative: BlockId
) -> ExprId
[src]
&mut self,
condition: ExprId,
consequent: BlockId,
alternative: BlockId
) -> ExprId
pub fn br_table(
&mut self,
which: ExprId,
blocks: Box<[BlockId]>,
default: BlockId,
args: Box<[ExprId]>
) -> ExprId
[src]
&mut self,
which: ExprId,
blocks: Box<[BlockId]>,
default: BlockId,
args: Box<[ExprId]>
) -> ExprId
pub fn drop(&mut self, expr: ExprId) -> ExprId
[src]
pub fn return_(&mut self, values: Box<[ExprId]>) -> ExprId
[src]
pub fn memory_size(&mut self, memory: MemoryId) -> ExprId
[src]
pub fn memory_grow(&mut self, memory: MemoryId, pages: ExprId) -> ExprId
[src]
pub fn memory_init(
&mut self,
memory: MemoryId,
data: DataId,
memory_offset: ExprId,
data_offset: ExprId,
len: ExprId
) -> ExprId
[src]
&mut self,
memory: MemoryId,
data: DataId,
memory_offset: ExprId,
data_offset: ExprId,
len: ExprId
) -> ExprId
pub fn data_drop(&mut self, data: DataId) -> ExprId
[src]
pub fn memory_copy(
&mut self,
src: MemoryId,
dst: MemoryId,
dst_offset: ExprId,
src_offset: ExprId,
len: ExprId
) -> ExprId
[src]
&mut self,
src: MemoryId,
dst: MemoryId,
dst_offset: ExprId,
src_offset: ExprId,
len: ExprId
) -> ExprId
pub fn memory_fill(
&mut self,
memory: MemoryId,
offset: ExprId,
value: ExprId,
len: ExprId
) -> ExprId
[src]
&mut self,
memory: MemoryId,
offset: ExprId,
value: ExprId,
len: ExprId
) -> ExprId
pub fn load(
&mut self,
memory: MemoryId,
kind: LoadKind,
arg: MemArg,
address: ExprId
) -> ExprId
[src]
&mut self,
memory: MemoryId,
kind: LoadKind,
arg: MemArg,
address: ExprId
) -> ExprId
pub fn store(
&mut self,
memory: MemoryId,
kind: StoreKind,
arg: MemArg,
address: ExprId,
value: ExprId
) -> ExprId
[src]
&mut self,
memory: MemoryId,
kind: StoreKind,
arg: MemArg,
address: ExprId,
value: ExprId
) -> ExprId
pub fn atomic_rmw(
&mut self,
memory: MemoryId,
op: AtomicOp,
width: AtomicWidth,
arg: MemArg,
address: ExprId,
value: ExprId
) -> ExprId
[src]
&mut self,
memory: MemoryId,
op: AtomicOp,
width: AtomicWidth,
arg: MemArg,
address: ExprId,
value: ExprId
) -> ExprId
pub fn cmpxchg(
&mut self,
memory: MemoryId,
width: AtomicWidth,
arg: MemArg,
address: ExprId,
expected: ExprId,
replacement: ExprId
) -> ExprId
[src]
&mut self,
memory: MemoryId,
width: AtomicWidth,
arg: MemArg,
address: ExprId,
expected: ExprId,
replacement: ExprId
) -> ExprId
pub fn atomic_notify(
&mut self,
memory: MemoryId,
arg: MemArg,
address: ExprId,
count: ExprId
) -> ExprId
[src]
&mut self,
memory: MemoryId,
arg: MemArg,
address: ExprId,
count: ExprId
) -> ExprId
pub fn atomic_wait(
&mut self,
memory: MemoryId,
arg: MemArg,
address: ExprId,
expected: ExprId,
timeout: ExprId,
sixty_four: bool
) -> ExprId
[src]
&mut self,
memory: MemoryId,
arg: MemArg,
address: ExprId,
expected: ExprId,
timeout: ExprId,
sixty_four: bool
) -> ExprId
pub fn with_side_effects(
&mut self,
before: Vec<ExprId>,
value: ExprId,
after: Vec<ExprId>
) -> ExprId
[src]
&mut self,
before: Vec<ExprId>,
value: ExprId,
after: Vec<ExprId>
) -> ExprId
pub fn table_get(&mut self, table: TableId, index: ExprId) -> ExprId
[src]
pub fn table_set(
&mut self,
table: TableId,
index: ExprId,
value: ExprId
) -> ExprId
[src]
&mut self,
table: TableId,
index: ExprId,
value: ExprId
) -> ExprId
pub fn table_grow(
&mut self,
table: TableId,
amount: ExprId,
value: ExprId
) -> ExprId
[src]
&mut self,
table: TableId,
amount: ExprId,
value: ExprId
) -> ExprId
pub fn table_size(&mut self, table: TableId) -> ExprId
[src]
pub fn ref_null(&mut self) -> ExprId
[src]
pub fn ref_is_null(&mut self, value: ExprId) -> ExprId
[src]
pub fn v128_bitselect(&mut self, mask: ExprId, v1: ExprId, v2: ExprId) -> ExprId
[src]
pub fn v128_shuffle(
&mut self,
indices: ShuffleIndices,
lo: ExprId,
hi: ExprId
) -> ExprId
[src]
&mut self,
indices: ShuffleIndices,
lo: ExprId,
hi: ExprId
) -> ExprId
Trait Implementations
impl<'_> Drop for BlockBuilder<'_>
[src]
impl<'_> Deref for BlockBuilder<'_>
[src]
type Target = FunctionBuilder
The resulting type after dereferencing.
fn deref(&self) -> &FunctionBuilder
[src]
impl<'a> Debug for BlockBuilder<'a>
[src]
impl<'_> DerefMut for BlockBuilder<'_>
[src]
fn deref_mut(&mut self) -> &mut FunctionBuilder
[src]
Auto Trait Implementations
impl<'a> Send for BlockBuilder<'a>
impl<'a> Sync for BlockBuilder<'a>
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,