Trait barter_data::ExchangeTransformer
source · [−]pub trait ExchangeTransformer: Transformer<MarketEvent> + Sized {
const EXCHANGE: ExchangeId;
fn new(ws_sink_tx: UnboundedSender<WsMessage>, ids: SubscriptionIds) -> Self;
}Expand description
Defines how to translate between exchange specific data structures & Barter data structures. This must be implemented when integrating a new exchange.
Required Associated Constants
sourceconst EXCHANGE: ExchangeId
const EXCHANGE: ExchangeId
Unique identifier for an ExchangeTransformer.
Required Methods
sourcefn new(ws_sink_tx: UnboundedSender<WsMessage>, ids: SubscriptionIds) -> Self
fn new(ws_sink_tx: UnboundedSender<WsMessage>, ids: SubscriptionIds) -> Self
Constructs a new ExchangeTransformer using a transmitter to the WsSink and the
SubscriptionIds HashMap.
Note:
- If required, the
WsSinktransmitter may be used to send messages to the exchange.