Struct sway_ir::instruction::InstructionInserter
source · pub struct InstructionInserter<'a> { /* private fields */ }
Expand description
Provide a context for appending new Instruction
s to a Block
.
Implementations§
source§impl<'a> InstructionInserter<'a>
impl<'a> InstructionInserter<'a>
sourcepub fn new(context: &'a mut Context, block: Block) -> InstructionInserter<'a>
pub fn new(context: &'a mut Context, block: Block) -> InstructionInserter<'a>
Return a new InstructionInserter
context for block
.
sourcepub fn asm_block(
self,
args: Vec<AsmArg>,
body: Vec<AsmInstruction>,
return_type: Type,
return_name: Option<Ident>
) -> Value
pub fn asm_block( self, args: Vec<AsmArg>, body: Vec<AsmInstruction>, return_type: Type, return_name: Option<Ident> ) -> Value
Append a new Instruction::AsmBlock
from args
and a body
.
pub fn asm_block_from_asm(self, asm: AsmBlock, args: Vec<AsmArg>) -> Value
pub fn addr_of(self, value: Value) -> Value
pub fn bitcast(self, value: Value, ty: Type) -> Value
pub fn binary_op(self, op: BinaryOpKind, arg1: Value, arg2: Value) -> Value
pub fn branch(self, to_block: Block, dest_params: Vec<Value>) -> Value
pub fn call(self, function: Function, args: &[Value]) -> Value
pub fn cast_ptr(self, val: Value, ty: Type, offs: u64) -> Value
pub fn cmp(self, pred: Predicate, lhs_value: Value, rhs_value: Value) -> Value
pub fn conditional_branch( self, cond_value: Value, true_block: Block, false_block: Block, true_dest_params: Vec<Value>, false_dest_params: Vec<Value> ) -> Value
pub fn contract_call( self, return_type: Type, name: String, params: Value, coins: Value, asset_id: Value, gas: Value ) -> Value
pub fn extract_element(self, array: Value, ty: Type, index_val: Value) -> Value
pub fn extract_value(self, aggregate: Value, ty: Type, indices: Vec<u64>) -> Value
pub fn get_storage_key(self) -> Value
pub fn gtf(self, index: Value, tx_field_id: u64) -> Value
pub fn get_local(self, local_var: LocalVar) -> Value
pub fn insert_element( self, array: Value, ty: Type, value: Value, index_val: Value ) -> Value
pub fn insert_value( self, aggregate: Value, ty: Type, value: Value, indices: Vec<u64> ) -> Value
pub fn int_to_ptr(self, value: Value, ty: Type) -> Value
pub fn load(self, src_val: Value) -> Value
pub fn log(self, log_val: Value, log_ty: Type, log_id: Value) -> Value
pub fn mem_copy(self, dst_val: Value, src_val: Value, byte_len: u64) -> Value
pub fn nop(self) -> Value
pub fn read_register(self, reg: Register) -> Value
pub fn ret(self, value: Value, ty: Type) -> Value
pub fn revert(self, value: Value) -> Value
pub fn smo( self, recipient_and_message: Value, message_size: Value, output_index: Value, coins: Value ) -> Value
pub fn state_clear(self, key: Value, number_of_slots: Value) -> Value
pub fn state_load_quad_word( self, load_val: Value, key: Value, number_of_slots: Value ) -> Value
pub fn state_load_word(self, key: Value) -> Value
pub fn state_store_quad_word( self, stored_val: Value, key: Value, number_of_slots: Value ) -> Value
pub fn state_store_word(self, stored_val: Value, key: Value) -> Value
pub fn store(self, dst_val: Value, stored_val: Value) -> Value
Auto Trait Implementations§
impl<'a> RefUnwindSafe for InstructionInserter<'a>
impl<'a> Send for InstructionInserter<'a>
impl<'a> Sync for InstructionInserter<'a>
impl<'a> Unpin for InstructionInserter<'a>
impl<'a> !UnwindSafe for InstructionInserter<'a>
Blanket Implementations§
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
source§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.