Skip to main content

PackageStore

Trait PackageStore 

Source
pub trait PackageStore:
    Send
    + Sync
    + 'static {
    // Required method
    fn fetch<'life0, 'async_trait>(
        &'life0 self,
        id: Address,
    ) -> 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: Address, ) -> 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: Address, ) -> 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.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl PackageStore for Arc<dyn PackageStore>

Source§

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

Source§

impl PackageStore for Box<dyn PackageStore>

Source§

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

Implementors§