Indexer

Trait Indexer 

Source
pub trait Indexer:
    Clone
    + Send
    + Sync
    + 'static {
    type Error: Error + Send + Sync + 'static;

    // Required methods
    fn submit_seed(
        &self,
        seed: Seed,
    ) -> impl Future<Output = Result<(), Self::Error>> + Send;
    fn listen_mempool(
        &self,
    ) -> impl Future<Output = Result<impl Stream<Item = Result<Pending, Self::Error>> + Send, Self::Error>> + Send;
    fn submit_summary(
        &self,
        summary: Summary,
    ) -> impl Future<Output = Result<(), Self::Error>> + Send;
}
Expand description

Trait for interacting with an indexer.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

Required Methods§

Source

fn submit_seed( &self, seed: Seed, ) -> impl Future<Output = Result<(), Self::Error>> + Send

Upload a seed to the indexer.

Source

fn listen_mempool( &self, ) -> impl Future<Output = Result<impl Stream<Item = Result<Pending, Self::Error>> + Send, Self::Error>> + Send

Get a stream of transactions from the indexer.

Source

fn submit_summary( &self, summary: Summary, ) -> impl Future<Output = Result<(), Self::Error>> + Send

Upload result

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.

Implementations on Foreign Types§

Source§

impl Indexer for Client

Source§

type Error = Error

Source§

async fn submit_seed(&self, seed: Seed) -> Result<(), Self::Error>

Source§

async fn listen_mempool( &self, ) -> Result<impl Stream<Item = Result<Pending, Self::Error>>, Self::Error>

Source§

async fn submit_summary(&self, summary: Summary) -> Result<(), Self::Error>

Implementors§

Source§

impl<I, E> Indexer for ReconnectingIndexer<I, E>
where I: Indexer, E: Rng + CryptoRng + Spawner + Clock + Clone + Send + Sync + 'static,

Source§

type Error = <I as Indexer>::Error