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

Provide a context for appending new Instructions to a Block.

Implementations§

source§

impl<'a> InstructionInserter<'a>

source

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

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 addr_of(self, value: Value) -> Value

source

pub fn bitcast(self, value: Value, ty: Type) -> 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, offs: u64) -> 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 extract_element(self, array: Value, ty: Type, index_val: Value) -> Value

source

pub fn extract_value(self, aggregate: Value, ty: Type, indices: Vec<u64>) -> Value

source

pub fn get_storage_key(self) -> Value

source

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

source

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

source

pub fn insert_element(
    self,
    array: Value,
    ty: Type,
    value: Value,
    index_val: Value
) -> Value

source

pub fn insert_value(
    self,
    aggregate: Value,
    ty: Type,
    value: Value,
    indices: Vec<u64>
) -> 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(self, dst_val: Value, src_val: Value, byte_len: u64) -> Value

source

pub fn nop(self) -> 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_and_message: Value,
    message_size: Value,
    output_index: 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: Value, stored_val: Value) -> Value

Auto Trait Implementations§

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,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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<'a, T> StorageAsMut for T

§

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

§

impl<'a, T> StorageAsRef for T

§

fn storage<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.
const: unstable · 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.
const: unstable · 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