pub struct InstructionInserter<'a, 'eng> { /* private fields */ }
Expand description

Provide a context for appending new Instructions to a Block.

Implementations§

source§

impl<'a, 'eng> InstructionInserter<'a, 'eng>

source

pub fn new( context: &'a mut Context<'eng>, block: Block ) -> InstructionInserter<'a, 'eng>

Return a new InstructionInserter context for block.

source

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.

source

pub fn asm_block_from_asm(self, asm: AsmBlock, args: Vec<AsmArg>) -> Value

source

pub fn bitcast(self, value: Value, ty: Type) -> Value

source

pub fn unary_op(self, op: UnaryOpKind, arg: Value) -> Value

source

pub fn wide_unary_op(self, op: UnaryOpKind, arg: Value, result: Value) -> Value

source

pub fn wide_binary_op( self, op: BinaryOpKind, arg1: Value, arg2: Value, result: Value ) -> Value

source

pub fn wide_modular_op( self, op: BinaryOpKind, result: Value, arg1: Value, arg2: Value, arg3: Value ) -> Value

source

pub fn wide_cmp_op(self, op: Predicate, arg1: Value, arg2: Value) -> Value

source

pub fn binary_op(self, op: BinaryOpKind, arg1: Value, arg2: Value) -> Value

source

pub fn branch(self, to_block: Block, dest_params: Vec<Value>) -> Value

source

pub fn call(self, function: Function, args: &[Value]) -> Value

source

pub fn cast_ptr(self, val: Value, ty: Type) -> Value

source

pub fn cmp(self, pred: Predicate, lhs_value: Value, rhs_value: Value) -> Value

source

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

source

pub fn contract_call( self, return_type: Type, name: String, params: Value, coins: Value, asset_id: Value, gas: Value ) -> Value

source

pub fn gtf(self, index: Value, tx_field_id: u64) -> Value

source

pub fn get_elem_ptr( self, base: Value, elem_ty: Type, indices: Vec<Value> ) -> Value

source

pub fn get_elem_ptr_with_idx( self, base: Value, elem_ty: Type, index: u64 ) -> Value

source

pub fn get_elem_ptr_with_idcs( self, base: Value, elem_ty: Type, indices: &[u64] ) -> Value

source

pub fn get_local(self, local_var: LocalVar) -> Value

source

pub fn int_to_ptr(self, value: Value, ty: Type) -> Value

source

pub fn load(self, src_val: Value) -> Value

source

pub fn log(self, log_val: Value, log_ty: Type, log_id: Value) -> Value

source

pub fn mem_copy_bytes( self, dst_val_ptr: Value, src_val_ptr: Value, byte_len: u64 ) -> Value

source

pub fn mem_copy_val(self, dst_val_ptr: Value, src_val_ptr: Value) -> Value

source

pub fn nop(self) -> Value

source

pub fn ptr_to_int(self, value: Value, ty: Type) -> Value

source

pub fn read_register(self, reg: Register) -> Value

source

pub fn ret(self, value: Value, ty: Type) -> Value

source

pub fn revert(self, value: Value) -> Value

source

pub fn smo( self, recipient: Value, message: Value, message_size: Value, coins: Value ) -> Value

source

pub fn state_clear(self, key: Value, number_of_slots: Value) -> Value

source

pub fn state_load_quad_word( self, load_val: Value, key: Value, number_of_slots: Value ) -> Value

source

pub fn state_load_word(self, key: Value) -> Value

source

pub fn state_store_quad_word( self, stored_val: Value, key: Value, number_of_slots: Value ) -> Value

source

pub fn state_store_word(self, stored_val: Value, key: Value) -> Value

source

pub fn store(self, dst_val_ptr: Value, stored_val: Value) -> Value

Auto Trait Implementations§

§

impl<'a, 'eng> RefUnwindSafe for InstructionInserter<'a, 'eng>

§

impl<'a, 'eng> Send for InstructionInserter<'a, 'eng>

§

impl<'a, 'eng> Sync for InstructionInserter<'a, 'eng>

§

impl<'a, 'eng> Unpin for InstructionInserter<'a, 'eng>

§

impl<'a, 'eng> !UnwindSafe for InstructionInserter<'a, 'eng>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Downcast for Twhere T: Any,

source§

fn into_any(self: Box<T, Global>) -> Box<dyn Any, 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, Global>) -> Rc<dyn Any, Global>

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)

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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
source§

impl<T> DowncastSync for Twhere T: Any + Send + Sync,

source§

fn into_any_arc(self: Arc<T, Global>) -> Arc<dyn Any + Sync + Send, Global>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

impl<T> StorageAsMut for T

§

fn storage<Type>(&mut self) -> StorageMut<'_, Self, Type>where Type: Mappable,

§

fn storage_as_mut<Type>(&mut self) -> StorageMut<'_, Self, Type>where Type: Mappable,

§

impl<T> StorageAsRef for T

§

fn storage<Type>(&self) -> StorageRef<'_, Self, Type>where Type: Mappable,

§

fn storage_as_ref<Type>(&self) -> StorageRef<'_, Self, Type>where Type: Mappable,

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V