pub trait SmartContractTrait<'a>: Send + Sync {
type P: JsonRpcProvider;
const DEFAULT_ITERATOR_COUNT: usize = 100usize;
Show 18 methods
// Required methods
fn script_hash(&self) -> H160;
fn provider(&self) -> Option<&RpcClient<Self::P>>;
// Provided methods
fn name<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn set_name(&mut self, _name: String) { ... }
fn set_script_hash(&mut self, _script_hash: H160) { ... }
fn invoke_function<'life0, 'life1, 'async_trait>(
&'life0 self,
function: &'life1 str,
params: Vec<ContractParameter>,
) -> Pin<Box<dyn Future<Output = Result<TransactionBuilder<'_, Self::P>, ContractError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn build_invoke_function_script<'life0, 'life1, 'async_trait>(
&'life0 self,
function: &'life1 str,
params: Vec<ContractParameter>,
) -> Pin<Box<dyn Future<Output = Result<Bytes, ContractError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn call_function_returning_string<'life0, 'life1, 'async_trait>(
&'life0 self,
function: &'life1 str,
params: Vec<ContractParameter>,
) -> Pin<Box<dyn Future<Output = Result<String, ContractError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn call_function_returning_int<'life0, 'life1, 'async_trait>(
&'life0 self,
function: &'life1 str,
params: Vec<ContractParameter>,
) -> Pin<Box<dyn Future<Output = Result<i32, ContractError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn call_function_returning_bool<'life0, 'life1, 'async_trait>(
&'life0 self,
function: &'life1 str,
params: Vec<ContractParameter>,
) -> Pin<Box<dyn Future<Output = Result<bool, ContractError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn call_invoke_function<'life0, 'life1, 'async_trait>(
&'life0 self,
function: &'life1 str,
params: Vec<ContractParameter>,
signers: Vec<Signer>,
) -> Pin<Box<dyn Future<Output = Result<InvocationResult, ContractError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn throw_if_fault_state(
&self,
output: &InvocationResult,
) -> Result<(), ContractError> { ... }
fn call_function_returning_script_hash<'life0, 'life1, 'async_trait>(
&'life0 self,
function: &'life1 str,
params: Vec<ContractParameter>,
) -> Pin<Box<dyn Future<Output = Result<H160, ContractError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn call_function_returning_iterator<'life0, 'life1, 'async_trait, U>(
&'life0 self,
function: &'life1 str,
params: Vec<ContractParameter>,
mapper: Arc<dyn Fn(StackItem) -> U + Send + Sync>,
) -> Pin<Box<dyn Future<Output = Result<NeoIterator<'_, U, Self::P>, ContractError>> + Send + 'async_trait>>
where U: Send + Sync + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn call_function_and_unwrap_iterator<'life0, 'life1, 'async_trait, U>(
&'life0 self,
function: &'life1 str,
params: Vec<ContractParameter>,
_max_items: usize,
mapper: impl 'async_trait + Fn(StackItem) -> U + Send,
) -> Pin<Box<dyn Future<Output = Result<Vec<U>, ContractError>> + Send + 'async_trait>>
where U: 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn calc_native_contract_hash(
contract_name: &str,
) -> Result<H160, ContractError> { ... }
fn calc_contract_hash(
sender: H160,
nef_checksum: u32,
contract_name: &str,
) -> Result<H160, ContractError> { ... }
fn get_manifest<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ContractManifest> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}
Provided Associated Constants§
const DEFAULT_ITERATOR_COUNT: usize = 100usize
Required Associated Types§
type P: JsonRpcProvider
Required Methods§
Provided Methods§
fn name<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_name(&mut self, _name: String)
fn set_script_hash(&mut self, _script_hash: H160)
fn invoke_function<'life0, 'life1, 'async_trait>(
&'life0 self,
function: &'life1 str,
params: Vec<ContractParameter>,
) -> Pin<Box<dyn Future<Output = Result<TransactionBuilder<'_, Self::P>, ContractError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn build_invoke_function_script<'life0, 'life1, 'async_trait>(
&'life0 self,
function: &'life1 str,
params: Vec<ContractParameter>,
) -> Pin<Box<dyn Future<Output = Result<Bytes, ContractError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn call_function_returning_string<'life0, 'life1, 'async_trait>(
&'life0 self,
function: &'life1 str,
params: Vec<ContractParameter>,
) -> Pin<Box<dyn Future<Output = Result<String, ContractError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn call_function_returning_int<'life0, 'life1, 'async_trait>(
&'life0 self,
function: &'life1 str,
params: Vec<ContractParameter>,
) -> Pin<Box<dyn Future<Output = Result<i32, ContractError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn call_function_returning_bool<'life0, 'life1, 'async_trait>(
&'life0 self,
function: &'life1 str,
params: Vec<ContractParameter>,
) -> Pin<Box<dyn Future<Output = Result<bool, ContractError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn call_invoke_function<'life0, 'life1, 'async_trait>(
&'life0 self,
function: &'life1 str,
params: Vec<ContractParameter>,
signers: Vec<Signer>,
) -> Pin<Box<dyn Future<Output = Result<InvocationResult, ContractError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn throw_if_fault_state( &self, output: &InvocationResult, ) -> Result<(), ContractError>
fn call_function_returning_script_hash<'life0, 'life1, 'async_trait>(
&'life0 self,
function: &'life1 str,
params: Vec<ContractParameter>,
) -> Pin<Box<dyn Future<Output = Result<H160, ContractError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn call_function_returning_iterator<'life0, 'life1, 'async_trait, U>( &'life0 self, function: &'life1 str, params: Vec<ContractParameter>, mapper: Arc<dyn Fn(StackItem) -> U + Send + Sync>, ) -> Pin<Box<dyn Future<Output = Result<NeoIterator<'_, U, Self::P>, ContractError>> + Send + 'async_trait>>
fn call_function_and_unwrap_iterator<'life0, 'life1, 'async_trait, U>(
&'life0 self,
function: &'life1 str,
params: Vec<ContractParameter>,
_max_items: usize,
mapper: impl 'async_trait + Fn(StackItem) -> U + Send,
) -> Pin<Box<dyn Future<Output = Result<Vec<U>, ContractError>> + Send + 'async_trait>>where
U: 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn calc_native_contract_hash(contract_name: &str) -> Result<H160, ContractError>
fn calc_contract_hash( sender: H160, nef_checksum: u32, contract_name: &str, ) -> Result<H160, ContractError>
fn get_manifest<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ContractManifest> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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.