Struct barter_data::subscription::Subscription

source ·
pub struct Subscription<Exchange = ExchangeId, Inst = Instrument, Kind = SubKind> {
    pub exchange: Exchange,
    pub instrument: Inst,
    pub kind: Kind,
}
Expand description

Barter Subscription used to subscribe to a SubscriptionKind for a particular exchange Instrument.

Fields§

§exchange: Exchange§instrument: Inst§kind: Kind

Implementations§

source§

impl<Instrument, Exchange, Kind> Subscription<Exchange, Instrument, Kind>

source

pub fn new<I>(exchange: Exchange, instrument: I, kind: Kind) -> Self
where I: Into<Instrument>,

Constructs a new Subscription using the provided configuration.

Trait Implementations§

source§

impl<Exchange: Clone, Inst: Clone, Kind: Clone> Clone for Subscription<Exchange, Inst, Kind>

source§

fn clone(&self) -> Subscription<Exchange, Inst, Kind>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Exchange: Debug, Inst: Debug, Kind: Debug> Debug for Subscription<Exchange, Inst, Kind>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de, Exchange, Inst, Kind> Deserialize<'de> for Subscription<Exchange, Inst, Kind>
where Exchange: Deserialize<'de>, Inst: Deserialize<'de>, Kind: Deserialize<'de>,

source§

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<Exchange, Instrument, Kind> Display for Subscription<Exchange, Instrument, Kind>
where Exchange: Display, Instrument: Display, Kind: Display,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Exchange, I, Instrument, Kind> From<(Exchange, I, Kind)> for Subscription<Exchange, Instrument, Kind>
where I: Into<Instrument>,

source§

fn from((exchange, instrument, kind): (Exchange, I, Kind)) -> Self

Converts to this type from the input type.
source§

impl<Exchange, S, Kind> From<(Exchange, S, S, InstrumentKind, Kind)> for Subscription<Exchange, Instrument, Kind>
where S: Into<Symbol>,

source§

fn from( (exchange, base, quote, instrument_kind, kind): (Exchange, S, S, InstrumentKind, Kind), ) -> Self

Converts to this type from the input type.
source§

impl<InstrumentId, Exchange, S, Kind> From<(InstrumentId, Exchange, S, S, InstrumentKind, Kind)> for Subscription<Exchange, KeyedInstrument<InstrumentId>, Kind>
where S: Into<Symbol>,

source§

fn from( (instrument_id, exchange, base, quote, instrument_kind, kind): (InstrumentId, Exchange, S, S, InstrumentKind, Kind), ) -> Self

Converts to this type from the input type.
source§

impl<Exchange: Hash, Inst: Hash, Kind: Hash> Hash for Subscription<Exchange, Inst, Kind>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<Instrument> Identifier<BinanceChannel> for Subscription<BinanceFuturesUsd, Instrument, Liquidations>

source§

impl<Server, Instrument> Identifier<BinanceChannel> for Subscription<Binance<Server>, Instrument, OrderBooksL1>

source§

impl<Server, Instrument> Identifier<BinanceChannel> for Subscription<Binance<Server>, Instrument, OrderBooksL2>

source§

impl<Server, Instrument> Identifier<BinanceChannel> for Subscription<Binance<Server>, Instrument, PublicTrades>

source§

impl<Server, Kind> Identifier<BinanceMarket> for Subscription<Binance<Server>, Instrument, Kind>

source§

impl<Server, Kind> Identifier<BinanceMarket> for Subscription<Binance<Server>, KeyedInstrument, Kind>

source§

impl<Server, Kind> Identifier<BinanceMarket> for Subscription<Binance<Server>, MarketInstrumentData, Kind>

source§

impl<Instrument> Identifier<BitfinexChannel> for Subscription<Bitfinex, Instrument, PublicTrades>

source§

impl<Kind> Identifier<BitfinexMarket> for Subscription<Bitfinex, Instrument, Kind>

source§

impl<Kind> Identifier<BitfinexMarket> for Subscription<Bitfinex, KeyedInstrument, Kind>

source§

impl<Kind> Identifier<BitfinexMarket> for Subscription<Bitfinex, MarketInstrumentData, Kind>

source§

impl<Instrument> Identifier<BitmexChannel> for Subscription<Bitmex, Instrument, PublicTrades>

source§

impl<Kind> Identifier<BitmexMarket> for Subscription<Bitmex, Instrument, Kind>

source§

impl<Kind> Identifier<BitmexMarket> for Subscription<Bitmex, KeyedInstrument, Kind>

source§

impl<Kind> Identifier<BitmexMarket> for Subscription<Bitmex, MarketInstrumentData, Kind>

source§

impl<Server, Instrument> Identifier<BybitChannel> for Subscription<Bybit<Server>, Instrument, PublicTrades>

source§

impl<Server, Kind> Identifier<BybitMarket> for Subscription<Bybit<Server>, Instrument, Kind>

source§

fn id(&self) -> BybitMarket

source§

impl<Server, Kind> Identifier<BybitMarket> for Subscription<Bybit<Server>, KeyedInstrument, Kind>

source§

fn id(&self) -> BybitMarket

source§

impl<Server, Kind> Identifier<BybitMarket> for Subscription<Bybit<Server>, MarketInstrumentData, Kind>

source§

fn id(&self) -> BybitMarket

source§

impl<Instrument> Identifier<CoinbaseChannel> for Subscription<Coinbase, Instrument, PublicTrades>

source§

impl<Kind> Identifier<CoinbaseMarket> for Subscription<Coinbase, Instrument, Kind>

source§

impl<Kind> Identifier<CoinbaseMarket> for Subscription<Coinbase, KeyedInstrument, Kind>

source§

impl<Kind> Identifier<CoinbaseMarket> for Subscription<Coinbase, MarketInstrumentData, Kind>

source§

impl<GateioExchange, Instrument> Identifier<GateioChannel> for Subscription<GateioExchange, Instrument, PublicTrades>
where Instrument: InstrumentData,

source§

impl<Server, Kind> Identifier<GateioMarket> for Subscription<Gateio<Server>, Instrument, Kind>

source§

impl<Server, Kind> Identifier<GateioMarket> for Subscription<Gateio<Server>, KeyedInstrument, Kind>

source§

impl<Server, Kind> Identifier<GateioMarket> for Subscription<Gateio<Server>, MarketInstrumentData, Kind>

source§

impl<Instrument> Identifier<KrakenChannel> for Subscription<Kraken, Instrument, OrderBooksL1>

source§

impl<Instrument> Identifier<KrakenChannel> for Subscription<Kraken, Instrument, PublicTrades>

source§

impl<Kind> Identifier<KrakenMarket> for Subscription<Kraken, Instrument, Kind>

source§

impl<Kind> Identifier<KrakenMarket> for Subscription<Kraken, KeyedInstrument, Kind>

source§

impl<Kind> Identifier<KrakenMarket> for Subscription<Kraken, MarketInstrumentData, Kind>

source§

impl<Instrument> Identifier<OkxChannel> for Subscription<Okx, Instrument, PublicTrades>

source§

fn id(&self) -> OkxChannel

source§

impl<Kind> Identifier<OkxMarket> for Subscription<Okx, Instrument, Kind>

source§

fn id(&self) -> OkxMarket

source§

impl<Kind> Identifier<OkxMarket> for Subscription<Okx, KeyedInstrument, Kind>

source§

fn id(&self) -> OkxMarket

source§

impl<Kind> Identifier<OkxMarket> for Subscription<Okx, MarketInstrumentData, Kind>

source§

fn id(&self) -> OkxMarket

source§

impl<Exchange: Ord, Inst: Ord, Kind: Ord> Ord for Subscription<Exchange, Inst, Kind>

source§

fn cmp(&self, other: &Subscription<Exchange, Inst, Kind>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl<Exchange: PartialEq, Inst: PartialEq, Kind: PartialEq> PartialEq for Subscription<Exchange, Inst, Kind>

source§

fn eq(&self, other: &Subscription<Exchange, Inst, Kind>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Exchange: PartialOrd, Inst: PartialOrd, Kind: PartialOrd> PartialOrd for Subscription<Exchange, Inst, Kind>

source§

fn partial_cmp( &self, other: &Subscription<Exchange, Inst, Kind>, ) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<Exchange, Inst, Kind> Serialize for Subscription<Exchange, Inst, Kind>
where Exchange: Serialize, Inst: Serialize, Kind: Serialize,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<Exchange, Kind> Validator for &Subscription<Exchange, Instrument, Kind>
where Exchange: Connector,

source§

fn validate(self) -> Result<Self, SocketError>
where Self: Sized,

Check if Self is valid for some use case.
source§

impl<Instrument> Validator for Subscription<ExchangeId, Instrument, SubKind>
where Instrument: InstrumentData,

source§

fn validate(self) -> Result<Self, SocketError>
where Self: Sized,

Check if Self is valid for some use case.
source§

impl<Exchange: Eq, Inst: Eq, Kind: Eq> Eq for Subscription<Exchange, Inst, Kind>

source§

impl<Exchange, Inst, Kind> StructuralPartialEq for Subscription<Exchange, Inst, Kind>

Auto Trait Implementations§

§

impl<Exchange, Inst, Kind> Freeze for Subscription<Exchange, Inst, Kind>
where Exchange: Freeze, Inst: Freeze, Kind: Freeze,

§

impl<Exchange, Inst, Kind> RefUnwindSafe for Subscription<Exchange, Inst, Kind>
where Exchange: RefUnwindSafe, Inst: RefUnwindSafe, Kind: RefUnwindSafe,

§

impl<Exchange, Inst, Kind> Send for Subscription<Exchange, Inst, Kind>
where Exchange: Send, Inst: Send, Kind: Send,

§

impl<Exchange, Inst, Kind> Sync for Subscription<Exchange, Inst, Kind>
where Exchange: Sync, Inst: Sync, Kind: Sync,

§

impl<Exchange, Inst, Kind> Unpin for Subscription<Exchange, Inst, Kind>
where Exchange: Unpin, Inst: Unpin, Kind: Unpin,

§

impl<Exchange, Inst, Kind> UnwindSafe for Subscription<Exchange, Inst, Kind>
where Exchange: UnwindSafe, Inst: UnwindSafe, Kind: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,