openzeppelin_monitor::services::blockwatcher

Trait BlockTrackerTrait

Source
pub trait BlockTrackerTrait<S: BlockStorage> {
    // Required methods
    fn new(history_size: usize, storage: Option<Arc<S>>) -> Self;
    fn record_block<'life0, 'life1, 'async_trait>(
        &'life0 self,
        network: &'life1 Network,
        block_number: u64,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_last_block<'life0, 'life1, 'async_trait>(
        &'life0 self,
        network_slug: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Option<u64>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait for the BlockTracker

This trait defines the interface for the BlockTracker.

Required Methods§

Source

fn new(history_size: usize, storage: Option<Arc<S>>) -> Self

Source

fn record_block<'life0, 'life1, 'async_trait>( &'life0 self, network: &'life1 Network, block_number: u64, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_last_block<'life0, 'life1, 'async_trait>( &'life0 self, network_slug: &'life1 str, ) -> Pin<Box<dyn Future<Output = Option<u64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§