Skip to main content

ContractModuleProvider

Trait ContractModuleProvider 

Source
pub trait ContractModuleProvider:
    Send
    + Sync
    + Debug {
    // Required method
    fn resolve<'life0, 'life1, 'async_trait>(
        &'life0 self,
        address: &'life1 ContractAddress,
    ) -> Pin<Box<dyn Future<Output = Result<Option<ContractModule>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Binds callee addresses to the code deployed there.

A binding is checked before it is used: the module must implement the contract type the caller declares, and its verifier keys must be the ones deployed at the address.

Required Methods§

Source

fn resolve<'life0, 'life1, 'async_trait>( &'life0 self, address: &'life1 ContractAddress, ) -> Pin<Box<dyn Future<Output = Result<Option<ContractModule>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The module for address, or Ok(None) when this provider binds nothing there.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: ContractModuleProvider + ?Sized> ContractModuleProvider for Arc<T>

Source§

fn resolve<'life0, 'life1, 'async_trait>( &'life0 self, address: &'life1 ContractAddress, ) -> Pin<Box<dyn Future<Output = Result<Option<ContractModule>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§