Skip to main content

CommitteeCache

Trait CommitteeCache 

Source
pub trait CommitteeCache: Send + Sync {
    // Required methods
    fn committee<'life0, 'async_trait>(
        &'life0 self,
        key: CommitteeCacheKey,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Committee>, CommitteeCacheError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn store<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: CommitteeCacheKey,
        committee: &'life1 Committee,
    ) -> Pin<Box<dyn Future<Output = Result<(), CommitteeCacheError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Stores authenticated committees for anchored resolution.

Implementations must preserve committee integrity after storage and use the complete CommitteeCacheKey for every lookup.

Required Methods§

Source

fn committee<'life0, 'async_trait>( &'life0 self, key: CommitteeCacheKey, ) -> Pin<Box<dyn Future<Output = Result<Option<Committee>, CommitteeCacheError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the authenticated committee for key, when available.

Source

fn store<'life0, 'life1, 'async_trait>( &'life0 self, key: CommitteeCacheKey, committee: &'life1 Committee, ) -> Pin<Box<dyn Future<Output = Result<(), CommitteeCacheError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Stores a committee under key after the resolver has authenticated it.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§