Struct ink_env::call::CallParams

source ·
pub struct CallParams<E, CallType, Args, R>
where E: Environment,
{ /* private fields */ }
Expand description

The final parameters to the cross-contract call.

Implementations§

source§

impl<E, Args, R> CallParams<E, Call<E>, Args, R>
where E: Environment,

source

pub fn callee(&self) -> &E::AccountId

Returns the account ID of the called contract instance.

source

pub fn ref_time_limit(&self) -> u64

Returns the chosen ref time limit for the called contract execution.

source

pub fn proof_size_limit(&self) -> u64

Returns the chosen proof size limit for the called contract execution.

source

pub fn storage_deposit_limit(&self) -> Option<&E::Balance>

Returns the chosen storage deposit limit for the called contract execution.

source

pub fn transferred_value(&self) -> &E::Balance

Returns the transferred value for the called contract.

source

pub fn call_flags(&self) -> &CallFlags

Returns the call flags.

source§

impl<E, Args, R> CallParams<E, Call<E>, Args, R>
where E: Environment, Args: Encode, R: Decode,

source

pub fn invoke(&self) -> R

Invokes the contract with the given built-up call parameters.

Returns the result of the contract execution.

§Panics

This method panics if it encounters an ink::env::Error or an [ink::primitives::LangError][ink_primitives::LangError]. If you want to handle those use the try_invoke method instead.

source

pub fn try_invoke(&self) -> Result<MessageResult<R>, Error>

Invokes the contract with the given built-up call parameters.

Returns the result of the contract execution.

§Note

On failure this returns an outer ink::env::Error or inner [ink::primitives::LangError][ink_primitives::LangError], both of which can be handled by the caller.

source§

impl<E, Args, R> CallParams<E, CallV1<E>, Args, R>
where E: Environment,

source

pub fn callee(&self) -> &E::AccountId

Returns the account ID of the called contract instance.

source

pub fn gas_limit(&self) -> Gas

Returns the chosen gas limit for the called contract execution.

source

pub fn transferred_value(&self) -> &E::Balance

Returns the transferred value for the called contract.

source

pub fn call_flags(&self) -> &CallFlags

Returns the call flags.

source§

impl<E, Args, R> CallParams<E, CallV1<E>, Args, R>
where E: Environment, Args: Encode, R: Decode,

source

pub fn invoke(&self) -> R

Invokes the contract with the given built-up call parameters.

Returns the result of the contract execution.

§Panics

This method panics if it encounters an ink::env::Error or an [ink::primitives::LangError][ink_primitives::LangError]. If you want to handle those use the try_invoke method instead.

source

pub fn try_invoke(&self) -> Result<MessageResult<R>, Error>

Invokes the contract with the given built-up call parameters.

Returns the result of the contract execution.

§Note

On failure this returns an outer ink::env::Error or inner [ink::primitives::LangError][ink_primitives::LangError], both of which can be handled by the caller.

source§

impl<E, Args, R> CallParams<E, DelegateCall<E>, Args, R>
where E: Environment,

source

pub fn code_hash(&self) -> &E::Hash

Returns the code hash which we use to perform a delegate call.

source

pub fn call_flags(&self) -> &CallFlags

Returns the call flags.

source§

impl<E, Args, R> CallParams<E, DelegateCall<E>, Args, R>
where E: Environment, Args: Encode, R: Decode,

source

pub fn invoke(&self) -> R

Invoke the contract using Delegate Call semantics with the given built-up call parameters.

Returns the result of the contract execution.

§Panics

This method panics if it encounters an ink::env::Error or an [ink::primitives::LangError][ink_primitives::LangError]. If you want to handle those use the try_invoke method instead.

source

pub fn try_invoke(&self) -> Result<MessageResult<R>, Error>

Invoke the contract using Delegate Call semantics with the given built-up call parameters.

Returns the result of the contract execution.

§Note

On failure this returns an outer ink::env::Error or inner [ink::primitives::LangError][ink_primitives::LangError], both of which can be handled by the caller.

source§

impl<E, CallType, Args, R> CallParams<E, CallType, Args, R>
where E: Environment,

source

pub fn exec_input(&self) -> &ExecutionInput<Args>

Returns the execution input.

Trait Implementations§

source§

impl<E, CallType: Debug, Args: Debug, R: Debug> Debug for CallParams<E, CallType, Args, R>
where E: Environment + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<E, CallType, Args, R> Freeze for CallParams<E, CallType, Args, R>
where CallType: Freeze, Args: Freeze,

§

impl<E, CallType, Args, R> RefUnwindSafe for CallParams<E, CallType, Args, R>
where CallType: RefUnwindSafe, Args: RefUnwindSafe,

§

impl<E, CallType, Args, R> Send for CallParams<E, CallType, Args, R>
where CallType: Send, Args: Send,

§

impl<E, CallType, Args, R> Sync for CallParams<E, CallType, Args, R>
where CallType: Sync, Args: Sync,

§

impl<E, CallType, Args, R> Unpin for CallParams<E, CallType, Args, R>
where CallType: Unpin, Args: Unpin,

§

impl<E, CallType, Args, R> UnwindSafe for CallParams<E, CallType, Args, R>
where CallType: UnwindSafe, Args: 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> Same for T

§

type Output = T

Should always be Self
§

impl<T> SaturatedConversion for T

§

fn saturated_from<T>(t: T) -> Self
where Self: UniqueSaturatedFrom<T>,

Convert from a value of T into an equivalent instance of Self. Read more
§

fn saturated_into<T>(self) -> T
where Self: UniqueSaturatedInto<T>,

Consume self to return an equivalent value of T. Read more
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.
§

impl<T, S> UniqueSaturatedInto<T> for S
where T: Bounded, S: TryInto<T>,

§

fn unique_saturated_into(self) -> T

Consume self to return an equivalent value of T.
§

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

§

fn vzip(self) -> V