Struct barter_data::model::subscription::Subscription
source · pub struct Subscription {
pub exchange: ExchangeId,
pub instrument: Instrument,
pub kind: SubKind,
}Expand description
Barter Subscription used to subscribe to a market SubKind for a particular
[Exchange]’s Instrument.
Fields§
§exchange: ExchangeId§instrument: Instrument§kind: SubKindImplementations§
source§impl Subscription
impl Subscription
sourcepub fn new<I>(exchange: ExchangeId, instrument: I, kind: SubKind) -> Selfwhere
I: Into<Instrument>,
pub fn new<I>(exchange: ExchangeId, instrument: I, kind: SubKind) -> Selfwhere
I: Into<Instrument>,
Constructs a new Subscription using the provided configuration.
Examples found in repository?
src/model/subscription.rs (line 80)
77 78 79 80 81 82 83 84 85 86 87 88 89 90
fn from(
(exchange, base, quote, instrument_kind, kind): (ExchangeId, S, S, InstrumentKind, SubKind),
) -> Self {
Self::new(exchange, (base, quote, instrument_kind), kind)
}
}
impl<I> From<(ExchangeId, I, SubKind)> for Subscription
where
I: Into<Instrument>,
{
fn from((exchange, instrument, stream): (ExchangeId, I, SubKind)) -> Self {
Self::new(exchange, instrument, stream)
}Trait Implementations§
source§impl Clone for Subscription
impl Clone for Subscription
source§fn clone(&self) -> Subscription
fn clone(&self) -> Subscription
Returns a copy 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 Debug for Subscription
impl Debug for Subscription
source§impl<'de> Deserialize<'de> for Subscription
impl<'de> Deserialize<'de> for Subscription
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 Display for Subscription
impl Display for Subscription
source§impl<I> From<(ExchangeId, I, SubKind)> for Subscriptionwhere
I: Into<Instrument>,
impl<I> From<(ExchangeId, I, SubKind)> for Subscriptionwhere
I: Into<Instrument>,
source§fn from((exchange, instrument, stream): (ExchangeId, I, SubKind)) -> Self
fn from((exchange, instrument, stream): (ExchangeId, I, SubKind)) -> Self
Converts to this type from the input type.
source§impl<S> From<(ExchangeId, S, S, InstrumentKind, SubKind)> for Subscriptionwhere
S: Into<Symbol>,
impl<S> From<(ExchangeId, S, S, InstrumentKind, SubKind)> for Subscriptionwhere
S: Into<Symbol>,
source§fn from(
(exchange, base, quote, instrument_kind, kind): (ExchangeId, S, S, InstrumentKind, SubKind)
) -> Self
fn from(
(exchange, base, quote, instrument_kind, kind): (ExchangeId, S, S, InstrumentKind, SubKind)
) -> Self
Converts to this type from the input type.
source§impl From<Subscription> for Market
impl From<Subscription> for Market
source§fn from(subscription: Subscription) -> Self
fn from(subscription: Subscription) -> Self
Converts to this type from the input type.
source§impl Hash for Subscription
impl Hash for Subscription
source§impl Ord for Subscription
impl Ord for Subscription
source§fn cmp(&self, other: &Subscription) -> Ordering
fn cmp(&self, other: &Subscription) -> 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 PartialEq<Subscription> for Subscription
impl PartialEq<Subscription> for Subscription
source§fn eq(&self, other: &Subscription) -> bool
fn eq(&self, other: &Subscription) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd<Subscription> for Subscription
impl PartialOrd<Subscription> for Subscription
source§fn partial_cmp(&self, other: &Subscription) -> Option<Ordering>
fn partial_cmp(&self, other: &Subscription) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl Serialize for Subscription
impl Serialize for Subscription
source§impl Validator for &Subscription
impl Validator for &Subscription
impl Eq for Subscription
impl StructuralEq for Subscription
impl StructuralPartialEq for Subscription
Auto Trait Implementations§
impl RefUnwindSafe for Subscription
impl Send for Subscription
impl Sync for Subscription
impl Unpin for Subscription
impl UnwindSafe for Subscription
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.