pub struct ContractCall<BigUint: BigUintApi + 'static, R> {
    pub arg_buffer: ArgBuffer,
    /* private fields */
}
Expand description

Represents metadata for calling another contract. Can transform into either an async call, transfer call or other types of calls.

Fields§

§arg_buffer: ArgBuffer

Implementations§

source§

impl<BigUint, R> ContractCall<BigUint, R>
where BigUint: BigUintApi,

source

pub fn new( to: Address, token: TokenIdentifier, payment: BigUint, endpoint_name: BoxedBytes ) -> Self

source

pub fn get_mut_arg_buffer(&mut self) -> &mut ArgBuffer

source

pub fn push_argument_raw_bytes(&mut self, bytes: &[u8])

Provided for cases where we build the contract call by hand.

source

pub fn async_call(self) -> AsyncCall<BigUint>

source

pub fn transfer_moax_execute(self) -> TransferMoaxExecute<BigUint>

Produces an MOAX (or no value) transfer-execute call, no callback. Will always result in a transferValueExecute call.

source

pub fn transfer_dct_execute(self) -> TransferDctExecute<BigUint>

Produces an DCT transfer-execute call, no callback. Will always result in a transferDCTExecute call.

source

pub fn transfer_execute(self) -> TransferExecute<BigUint>

Produces a transfer-execute call, no callback. Will result in either a transferValueExecute or a transferDCTExecute call, depending on input.

source§

impl<BigUint, R> ContractCall<BigUint, R>
where BigUint: BigUintApi, R: DynArg,

source

pub fn execute_on_dest_context<SA>(self, gas: u64, api: SA) -> R
where SA: SendApi<BigUint>,

Executes immediately, synchronously, and returns contract call result. Only works if the target contract is in the same shard.

Auto Trait Implementations§

§

impl<BigUint, R> RefUnwindSafe for ContractCall<BigUint, R>
where BigUint: RefUnwindSafe, R: RefUnwindSafe,

§

impl<BigUint, R> Send for ContractCall<BigUint, R>
where BigUint: Send, R: Send,

§

impl<BigUint, R> Sync for ContractCall<BigUint, R>
where BigUint: Sync, R: Sync,

§

impl<BigUint, R> Unpin for ContractCall<BigUint, R>
where BigUint: Unpin, R: Unpin,

§

impl<BigUint, R> UnwindSafe for ContractCall<BigUint, R>
where BigUint: UnwindSafe, R: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where 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, U> TryFrom<U> for T
where 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 T
where 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.