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,
impl<E, Args, R> CallParams<E, Call<E>, Args, R>where
E: Environment,
sourcepub fn ref_time_limit(&self) -> u64
pub fn ref_time_limit(&self) -> u64
Returns the chosen ref time limit for the called contract execution.
sourcepub fn proof_size_limit(&self) -> u64
pub fn proof_size_limit(&self) -> u64
Returns the chosen proof size limit for the called contract execution.
sourcepub fn storage_deposit_limit(&self) -> Option<&E::Balance>
pub fn storage_deposit_limit(&self) -> Option<&E::Balance>
Returns the chosen storage deposit limit for the called contract execution.
sourcepub fn transferred_value(&self) -> &E::Balance
pub fn transferred_value(&self) -> &E::Balance
Returns the transferred value for the called contract.
sourcepub fn call_flags(&self) -> &CallFlags
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,
impl<E, Args, R> CallParams<E, Call<E>, Args, R>where
E: Environment,
Args: Encode,
R: Decode,
sourcepub fn invoke(&self) -> R
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.
sourcepub fn try_invoke(&self) -> Result<MessageResult<R>, Error>
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,
impl<E, Args, R> CallParams<E, CallV1<E>, Args, R>where
E: Environment,
sourcepub fn transferred_value(&self) -> &E::Balance
pub fn transferred_value(&self) -> &E::Balance
Returns the transferred value for the called contract.
sourcepub fn call_flags(&self) -> &CallFlags
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,
impl<E, Args, R> CallParams<E, CallV1<E>, Args, R>where
E: Environment,
Args: Encode,
R: Decode,
sourcepub fn invoke(&self) -> R
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.
sourcepub fn try_invoke(&self) -> Result<MessageResult<R>, Error>
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,
impl<E, Args, R> CallParams<E, DelegateCall<E>, Args, R>where
E: Environment,
source§impl<E, Args, R> CallParams<E, DelegateCall<E>, Args, R>where
E: Environment,
Args: Encode,
R: Decode,
impl<E, Args, R> CallParams<E, DelegateCall<E>, Args, R>where
E: Environment,
Args: Encode,
R: Decode,
sourcepub fn invoke(&self) -> R
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.
sourcepub fn try_invoke(&self) -> Result<MessageResult<R>, Error>
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,
impl<E, CallType, Args, R> CallParams<E, CallType, Args, R>where
E: Environment,
sourcepub fn exec_input(&self) -> &ExecutionInput<Args>
pub fn exec_input(&self) -> &ExecutionInput<Args>
Returns the execution input.
Trait Implementations§
Auto Trait Implementations§
impl<E, CallType, Args, R> Freeze for CallParams<E, CallType, Args, R>
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>
impl<E, CallType, Args, R> Sync for CallParams<E, CallType, Args, R>
impl<E, CallType, Args, R> Unpin for CallParams<E, CallType, Args, R>
impl<E, CallType, Args, R> UnwindSafe for CallParams<E, CallType, Args, R>where
CallType: UnwindSafe,
Args: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T
. Read more§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.