Trait iota_package_resolver::PackageStore

source ·
pub trait PackageStore:
    Send
    + Sync
    + 'static {
    // Required method
    fn fetch<'life0, 'async_trait>(
        &'life0 self,
        id: AccountAddress,
    ) -> Pin<Box<dyn Future<Output = Result<Arc<Package>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Interface to abstract over access to a store of live packages. Used to override the default store during testing.

Required Methods§

source

fn fetch<'life0, 'async_trait>( &'life0 self, id: AccountAddress, ) -> Pin<Box<dyn Future<Output = Result<Arc<Package>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Read package contents. Fails if id is not an object, not a package, or is malformed in some way.

Trait Implementations§

source§

impl PackageStore for Box<dyn PackageStore>

source§

fn fetch<'life0, 'async_trait>( &'life0 self, id: AccountAddress, ) -> Pin<Box<dyn Future<Output = Result<Arc<Package>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Read package contents. Fails if id is not an object, not a package, or is malformed in some way.

Implementations on Foreign Types§

source§

impl PackageStore for Box<dyn PackageStore>

source§

fn fetch<'life0, 'async_trait>( &'life0 self, id: AccountAddress, ) -> Pin<Box<dyn Future<Output = Result<Arc<Package>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

impl PackageStore for Arc<dyn PackageStore>

source§

fn fetch<'life0, 'async_trait>( &'life0 self, id: AccountAddress, ) -> Pin<Box<dyn Future<Output = Result<Arc<Package>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§