pub struct Subscription {
pub depth: Option<i64>,
pub interval: Option<i64>,
pub name: Option<SubscriptionName>,
pub rate_counter: Option<bool>,
pub snapshot: Option<bool>,
pub token: Option<Token>,
pub consolidate_taker: Option<bool>,
}
Expand description
General struct for subscribing to any channel.
Not all fields apply to each subscription, see the individual new_*
methods for constructing
well-formed subscriptions for each channel.
Fields§
§depth: Option<i64>
§interval: Option<i64>
§name: Option<SubscriptionName>
§rate_counter: Option<bool>
§snapshot: Option<bool>
§token: Option<Token>
§consolidate_taker: Option<bool>
Implementations§
Source§impl Subscription
impl Subscription
Sourcepub fn new_book_subscription(depth: Option<i64>) -> Subscription
pub fn new_book_subscription(depth: Option<i64>) -> Subscription
Create a new subscription to the orderbook at a given depth.
Sourcepub fn new_ohlc_subscription(interval: Option<i64>) -> Subscription
pub fn new_ohlc_subscription(interval: Option<i64>) -> Subscription
Create a new subscription to the OHLC channel at the given interval.
Sourcepub fn new_own_trades_subscription(
token: Token,
snapshot: Option<bool>,
) -> Subscription
pub fn new_own_trades_subscription( token: Token, snapshot: Option<bool>, ) -> Subscription
Create a new subscription to the OwnTrades channel for a specific token.
Optionally receive a snapshot of recent orders.
Sourcepub fn new_trades_subscription() -> Subscription
pub fn new_trades_subscription() -> Subscription
Create a new subscription to the public trades channel.
Sourcepub fn new_ticker_subscription() -> Subscription
pub fn new_ticker_subscription() -> Subscription
Create a new subscription to the Ticker channel.
Sourcepub fn new_spread_subscription() -> Subscription
pub fn new_spread_subscription() -> Subscription
Create a new subscription to the Spread channel for best bids/asks.
Sourcepub fn new_open_orders_subscription(
token: Token,
rate_counter: Option<bool>,
) -> Subscription
pub fn new_open_orders_subscription( token: Token, rate_counter: Option<bool>, ) -> Subscription
Create a new subscription to all open orders for the user.
Optionally get rate limiter updates from the server.
Trait Implementations§
Source§impl Clone for Subscription
impl Clone for Subscription
Source§fn clone(&self) -> Subscription
fn clone(&self) -> Subscription
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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>,
Source§impl From<Subscription> for Unsubscription
impl From<Subscription> for Unsubscription
Using a given Subscription message, generate the corresponding Unsubscription message.