Struct barter_data::streams::Streams
source · pub struct Streams<T> {
pub streams: HashMap<ExchangeId, UnboundedReceiver<T>>,
}Expand description
Ergonomic collection of exchange MarketEvent<T> receivers.
Fields§
§streams: HashMap<ExchangeId, UnboundedReceiver<T>>Implementations§
source§impl<T> Streams<T>
impl<T> Streams<T>
sourcepub fn builder<Kind>() -> StreamBuilder<Kind>where
Kind: SubKind,
pub fn builder<Kind>() -> StreamBuilder<Kind>where
Kind: SubKind,
Construct a StreamBuilder for configuring new
MarketEvent<SubKind::Event> Streams.
sourcepub fn builder_multi() -> MultiStreamBuilder<T>
pub fn builder_multi() -> MultiStreamBuilder<T>
Construct a MultiStreamBuilder for configuring new
MarketEvent<T> Streams.
sourcepub fn select(&mut self, exchange: ExchangeId) -> Option<UnboundedReceiver<T>>
pub fn select(&mut self, exchange: ExchangeId) -> Option<UnboundedReceiver<T>>
Remove an exchange mpsc::UnboundedReceiver from the Streams HashMap.
sourcepub async fn join(self) -> UnboundedReceiver<T>where
T: Send + 'static,
pub async fn join(self) -> UnboundedReceiver<T>where
T: Send + 'static,
Join all exchange mpsc::UnboundedReceiver streams into a unified
mpsc::UnboundedReceiver.
sourcepub async fn join_map(self) -> StreamMap<ExchangeId, UnboundedReceiverStream<T>>
pub async fn join_map(self) -> StreamMap<ExchangeId, UnboundedReceiverStream<T>>
Join all exchange mpsc::UnboundedReceiver streams into a unified StreamMap.