pub struct ExchangeSub<Channel, Market> {
pub channel: Channel,
pub market: Market,
}Expand description
Defines an exchange specific market and channel combination used by an exchange
Connector to build the
WsMessage subscription payloads to
send to the exchange server.
§Examples
§Binance OrderBooksL2
ExchangeSub {
channel: BinanceChannel("@depth@100ms"),
market: BinanceMarket("btcusdt"),
}§Kraken PublicTrades
ExchangeSub {
channel: KrakenChannel("trade"),
market: KrakenChannel("BTC/USDT")
}Fields§
§channel: ChannelType that defines how to translate a Barter Subscription into an exchange specific
channel to be subscribed to.
§Examples
market: MarketType that defines how to translate a Barter Subscription into an exchange specific
market that can be subscribed to.
§Examples
Implementations§
Source§impl<Channel, Market> ExchangeSub<Channel, Market>
impl<Channel, Market> ExchangeSub<Channel, Market>
Sourcepub fn new<Exchange, Instrument, Kind>(
sub: &Subscription<Exchange, Instrument, Kind>,
) -> Self
pub fn new<Exchange, Instrument, Kind>( sub: &Subscription<Exchange, Instrument, Kind>, ) -> Self
Construct a new exchange specific Self with the Barter Subscription provided.
Trait Implementations§
Source§impl<Channel: Clone, Market: Clone> Clone for ExchangeSub<Channel, Market>
impl<Channel: Clone, Market: Clone> Clone for ExchangeSub<Channel, Market>
Source§fn clone(&self) -> ExchangeSub<Channel, Market>
fn clone(&self) -> ExchangeSub<Channel, Market>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'de, Channel, Market> Deserialize<'de> for ExchangeSub<Channel, Market>where
Channel: Deserialize<'de>,
Market: Deserialize<'de>,
impl<'de, Channel, Market> Deserialize<'de> for ExchangeSub<Channel, Market>where
Channel: Deserialize<'de>,
Market: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<Channel, Market> From<(Channel, Market)> for ExchangeSub<Channel, Market>
impl<Channel, Market> From<(Channel, Market)> for ExchangeSub<Channel, Market>
Source§fn from((channel, market): (Channel, Market)) -> Self
fn from((channel, market): (Channel, Market)) -> Self
Converts to this type from the input type.
Source§impl<Channel, Market> Identifier<SubscriptionId> for ExchangeSub<Channel, Market>
impl<Channel, Market> Identifier<SubscriptionId> for ExchangeSub<Channel, Market>
fn id(&self) -> SubscriptionId
Source§impl<Channel: Ord, Market: Ord> Ord for ExchangeSub<Channel, Market>
impl<Channel: Ord, Market: Ord> Ord for ExchangeSub<Channel, Market>
Source§fn cmp(&self, other: &ExchangeSub<Channel, Market>) -> Ordering
fn cmp(&self, other: &ExchangeSub<Channel, Market>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<Channel: PartialEq, Market: PartialEq> PartialEq for ExchangeSub<Channel, Market>
impl<Channel: PartialEq, Market: PartialEq> PartialEq for ExchangeSub<Channel, Market>
Source§fn eq(&self, other: &ExchangeSub<Channel, Market>) -> bool
fn eq(&self, other: &ExchangeSub<Channel, Market>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<Channel: PartialOrd, Market: PartialOrd> PartialOrd for ExchangeSub<Channel, Market>
impl<Channel: PartialOrd, Market: PartialOrd> PartialOrd for ExchangeSub<Channel, Market>
Source§impl Serialize for ExchangeSub<OkxChannel, OkxMarket>
impl Serialize for ExchangeSub<OkxChannel, OkxMarket>
impl<Channel: Eq, Market: Eq> Eq for ExchangeSub<Channel, Market>
impl<Channel, Market> StructuralPartialEq for ExchangeSub<Channel, Market>
Auto Trait Implementations§
impl<Channel, Market> Freeze for ExchangeSub<Channel, Market>
impl<Channel, Market> RefUnwindSafe for ExchangeSub<Channel, Market>where
Channel: RefUnwindSafe,
Market: RefUnwindSafe,
impl<Channel, Market> Send for ExchangeSub<Channel, Market>
impl<Channel, Market> Sync for ExchangeSub<Channel, Market>
impl<Channel, Market> Unpin for ExchangeSub<Channel, Market>
impl<Channel, Market> UnwindSafe for ExchangeSub<Channel, Market>where
Channel: UnwindSafe,
Market: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more