Skip to main content

SequenceBackend

Trait SequenceBackend 

pub trait SequenceBackend: Send {
    // Required methods
    fn fetch_oracle_info(&self) -> OracleInfoService;
    fn start_lyquid(
        &mut self,
        lyquid: &LyquidID,
        sequence: Sequence,
        store: Arc<dyn KVStore>,
    ) -> Result<LyquidBackendHandle, Error>;
    fn stop_lyquid(&mut self, lyquid: &LyquidID) -> Result<(), Error>;
    fn shutdown<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn prune<'life0, 'async_trait>(
        &'life0 self,
        until: u64,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

The slot retrieving backend for a totally ordered sequence (i.e. a chain).

Required Methods§

fn fetch_oracle_info(&self) -> OracleInfoService

Backend-level pull endpoint for oracle epoch/config queries.

fn start_lyquid( &mut self, lyquid: &LyquidID, sequence: Sequence, store: Arc<dyn KVStore>, ) -> Result<LyquidBackendHandle, Error>

Start backend tracking for the given lyquid and return a client handle for call submission.

fn stop_lyquid(&mut self, lyquid: &LyquidID) -> Result<(), Error>

Stop backend tracking for a given lyquid.

This operation must be idempotent.

fn shutdown<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Stop the backend.

Provided Methods§

fn prune<'life0, 'async_trait>( &'life0 self, until: u64, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Let the backend prune all its persisted data prior to the given block number (exclusive).

Implementors§