Skip to main content

Store

Trait Store 

Source
pub trait Store: Sync {
    // Required method
    fn latest<'life0, 'async_trait>(
        &'life0 self,
        id: AccountAddress,
    ) -> Pin<Box<dyn Future<Output = Result<Option<(MoveTypeLayout, Vec<u8>)>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn scoped<'life0, 'async_trait>(
        &'life0 self,
        id: AccountAddress,
    ) -> Pin<Box<dyn Future<Output = Result<Option<(MoveTypeLayout, Vec<u8>)>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Dynamically load objects by their ID, returning the object’s owned data.

The Store trait is responsible only for fetching object data – lifetime management and caching are handled by the Interpreter. The interpreter can potentially issue racing requests for the same object, and it is the store’s responsibility to handle this correctly (e.g. by deduplicating in-flight requests).

Required Methods§

Source

fn latest<'life0, 'async_trait>( &'life0 self, id: AccountAddress, ) -> Pin<Box<dyn Future<Output = Result<Option<(MoveTypeLayout, Vec<u8>)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

Source

fn scoped<'life0, 'async_trait>( &'life0 self, id: AccountAddress, ) -> Pin<Box<dyn Future<Output = Result<Option<(MoveTypeLayout, Vec<u8>)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§