pub trait ContractCall<SA>: Sized + ContractCallBase<SA>where
SA: CallTypeApi + 'static,{
Show 13 methods
// Required method
fn transfer_execute(self);
// Provided methods
fn argument<T>(self, arg: &T) -> Self
where T: TopEncodeMulti { ... }
fn push_raw_argument<RawArg>(&mut self, raw_arg: RawArg)
where RawArg: Into<ManagedBuffer<SA>> { ... }
fn with_raw_arguments(
self,
raw_argument_buffer: ManagedArgBuffer<SA>,
) -> Self { ... }
fn with_gas_limit(self, gas_limit: u64) -> Self { ... }
fn into_call_data_string(self) -> ManagedBuffer<SA> { ... }
fn async_call(
self,
) -> Tx<TxScEnv<SA>, (), ManagedAddress<SA>, Egld<BigUint<SA>>, (), FunctionCall<SA>, Option<CallbackClosure<SA>>> { ... }
fn async_call_promise(self) -> AsyncCallPromises<SA> { ... }
fn execute_on_dest_context<RequestedResult>(self) -> RequestedResult
where RequestedResult: TopDecodeMulti { ... }
fn execute_on_dest_context_with_back_transfers<RequestedResult>(
self,
) -> (RequestedResult, BackTransfers<SA>)
where RequestedResult: TopDecodeMulti { ... }
fn execute_on_dest_context_ignore_result(self) { ... }
fn execute_on_dest_context_readonly<RequestedResult>(
self,
) -> RequestedResult
where RequestedResult: TopDecodeMulti { ... }
fn execute_on_same_context<RequestedResult>(self) -> RequestedResult
where RequestedResult: TopDecodeMulti { ... }
}
Expand description
Defines a contract call object, which is the basis for all calls to other contracts.
Its implementations differ on the type of payment that gets sent with the call.
Required Methods§
Sourcefn transfer_execute(self)
fn transfer_execute(self)
Immediately launches a transfer-execute call.
This is similar to an async call, but there is no callback and there can be more than one such call per transaction.
Provided Methods§
Sourcefn argument<T>(self, arg: &T) -> Selfwhere
T: TopEncodeMulti,
fn argument<T>(self, arg: &T) -> Selfwhere
T: TopEncodeMulti,
Serializes and pushes a value to the arguments buffer.
Accepts multi-values, so it might effectively be adding more than one raw argument.
Warning: this method serializes any serializable type, but does no type checking against the destination endpoint ABI. Only use for raw calls, built without a proxy.
Sourcefn push_raw_argument<RawArg>(&mut self, raw_arg: RawArg)where
RawArg: Into<ManagedBuffer<SA>>,
fn push_raw_argument<RawArg>(&mut self, raw_arg: RawArg)where
RawArg: Into<ManagedBuffer<SA>>,
For cases where we build the contract call by hand.
No serialization occurs, just direct conversion to ManagedBuffer.
Sourcefn with_raw_arguments(self, raw_argument_buffer: ManagedArgBuffer<SA>) -> Self
fn with_raw_arguments(self, raw_argument_buffer: ManagedArgBuffer<SA>) -> Self
For cases where we build the contract call by hand.
Sourcefn with_gas_limit(self, gas_limit: u64) -> Self
fn with_gas_limit(self, gas_limit: u64) -> Self
Sets an explicit gas limit to the call.
fn into_call_data_string(self) -> ManagedBuffer<SA>
Sourcefn async_call(
self,
) -> Tx<TxScEnv<SA>, (), ManagedAddress<SA>, Egld<BigUint<SA>>, (), FunctionCall<SA>, Option<CallbackClosure<SA>>>
fn async_call( self, ) -> Tx<TxScEnv<SA>, (), ManagedAddress<SA>, Egld<BigUint<SA>>, (), FunctionCall<SA>, Option<CallbackClosure<SA>>>
Converts to a legacy async call.
Sourcefn async_call_promise(self) -> AsyncCallPromises<SA>
fn async_call_promise(self) -> AsyncCallPromises<SA>
Converts to an async promise.
Sourcefn execute_on_dest_context<RequestedResult>(self) -> RequestedResultwhere
RequestedResult: TopDecodeMulti,
fn execute_on_dest_context<RequestedResult>(self) -> RequestedResultwhere
RequestedResult: TopDecodeMulti,
Executes immediately, synchronously, and returns contract call result. Only works if the target contract is in the same shard.
Sourcefn execute_on_dest_context_with_back_transfers<RequestedResult>(
self,
) -> (RequestedResult, BackTransfers<SA>)where
RequestedResult: TopDecodeMulti,
fn execute_on_dest_context_with_back_transfers<RequestedResult>(
self,
) -> (RequestedResult, BackTransfers<SA>)where
RequestedResult: TopDecodeMulti,
Executes immediately, synchronously, and returns contract call result. Only works if the target contract is in the same shard.
Sourcefn execute_on_dest_context_ignore_result(self)
👎Deprecated since 0.36.1: Redundant method, use let _: IgnoreValue = contract_call.execute_on_dest_context(...)
instead
fn execute_on_dest_context_ignore_result(self)
let _: IgnoreValue = contract_call.execute_on_dest_context(...)
insteadExecutes immediately, synchronously.
The result (if any) is ignored.
Deprecated and will be removed soon. Use execute_on_dest_context::<IgnoreValue>(...)
instead.
Sourcefn execute_on_dest_context_readonly<RequestedResult>(self) -> RequestedResultwhere
RequestedResult: TopDecodeMulti,
fn execute_on_dest_context_readonly<RequestedResult>(self) -> RequestedResultwhere
RequestedResult: TopDecodeMulti,
Executes immediately, synchronously, and returns contract call result.
Performs a readonly call.
Sourcefn execute_on_same_context<RequestedResult>(self) -> RequestedResultwhere
RequestedResult: TopDecodeMulti,
fn execute_on_same_context<RequestedResult>(self) -> RequestedResultwhere
RequestedResult: TopDecodeMulti,
Executes immediately, synchronously, and returns contract call result.
Performs call on the same context, i.e. the target contract will operate with the data from this contract.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.