cxmr_rpc/lib.rs
1//! Crypto-bank RPC service primitives.
2
3use async_trait::async_trait;
4
5use cxmr_exchanges::Market;
6use cxmr_orderbook::OrderBook;
7
8/// Service trait.
9#[async_trait]
10pub trait Service: Send + Sync {
11 /// Service error type.
12 type Error;
13
14 /// Returns all orderbooks in the service.
15 async fn orderbooks(&self) -> Result<Vec<(Market, OrderBook)>, Self::Error>;
16}
17
18/// Shared service client type alias.
19pub type SharedService<E> = Box<dyn Service<Error = E>>;