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§
Required Methods§
Sourcefn get_orders(
&self,
) -> impl Stream<Item = Result<SignedOrder, Self::Error>> + Send
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.