Skip to main content

OrderSource

Trait OrderSource 

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

    // Required method
    fn get_orders(
        &self,
    ) -> impl Stream<Item = Result<SignedOrder, Self::Error>> + Send;
}
Expand description

A trait for fetching orders from a source.

Implementors of this trait provide access to signed orders, typically from a transaction cache.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

The error type returned by the stream.

Required Methods§

Source

fn get_orders( &self, ) -> impl Stream<Item = Result<SignedOrder, Self::Error>> + Send

Fetch orders from the source as a stream.

Returns a stream of orders that automatically handles pagination. The stream yields Result<SignedOrder, Self::Error> to allow for error propagation during iteration.

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 OrderSource for TxCache

Source§

type Error = TxCacheError

Source§

fn get_orders( &self, ) -> impl Stream<Item = Result<SignedOrder, Self::Error>> + Send

Implementors§