pub enum Topic {
AggTrade {
symbol: String,
},
Depth {
symbol: String,
depth: OrderbookDepth,
},
BookTicker {
symbol: String,
},
MarkPrice {
symbol: String,
},
Kline {
symbol: String,
interval: KlineInterval,
},
ForceOrder {
symbol: String,
},
AllTickers,
AllMarkPrices,
AllBookTickers,
AllForceOrders,
}Expand description
A WebSocket subscription topic.
Topics are created using the static constructor methods and converted to
the wire format automatically when passed to subscribe().
§Available Topics
| Topic | Description |
|---|---|
Topic::agg_trade | Aggregated trade updates |
Topic::depth | Order book depth snapshots |
Topic::book_ticker | Best bid/ask prices |
Topic::mark_price | Mark price updates |
Topic::kline | Candlestick/kline data |
Topic::force_order | Liquidation orders |
Topic::all_tickers | All symbol mini tickers |
Topic::all_mark_prices | All mark prices |
Topic::all_book_tickers | All best bid/ask |
Topic::all_force_orders | All liquidations |
Variants§
AggTrade
Aggregated trade stream for a symbol.
Depth
Order book depth stream with configurable levels.
BookTicker
Best bid/ask stream for a symbol.
MarkPrice
Mark price stream for a symbol.
Kline
Kline/candlestick stream for a symbol at an interval.
ForceOrder
Liquidation order stream for a symbol.
AllTickers
All symbols mini ticker stream.
AllMarkPrices
All symbols mark price stream.
AllBookTickers
All symbols book ticker stream.
AllForceOrders
All symbols liquidation stream.
Implementations§
Source§impl Topic
impl Topic
Sourcepub fn agg_trade(symbol: impl Into<String>) -> Self
pub fn agg_trade(symbol: impl Into<String>) -> Self
Subscribe to aggregated trades for a symbol.
§Example
use bullet_rust_sdk::ws::topics::Topic;
let topic = Topic::agg_trade("BTC-USD");
assert_eq!(topic.to_string(), "BTC-USD@aggTrade");Sourcepub fn depth(symbol: impl Into<String>, depth: OrderbookDepth) -> Self
pub fn depth(symbol: impl Into<String>, depth: OrderbookDepth) -> Self
Subscribe to order book depth for a symbol.
§Example
use bullet_rust_sdk::ws::topics::{OrderbookDepth, Topic};
let topic = Topic::depth("BTC-USD", OrderbookDepth::D10);
assert_eq!(topic.to_string(), "BTC-USD@depth10");Sourcepub fn book_ticker(symbol: impl Into<String>) -> Self
pub fn book_ticker(symbol: impl Into<String>) -> Self
Subscribe to best bid/ask for a symbol.
§Example
use bullet_rust_sdk::ws::topics::Topic;
let topic = Topic::book_ticker("BTC-USD");
assert_eq!(topic.to_string(), "BTC-USD@bookTicker");Sourcepub fn mark_price(symbol: impl Into<String>) -> Self
pub fn mark_price(symbol: impl Into<String>) -> Self
Subscribe to mark price updates for a symbol.
§Example
use bullet_rust_sdk::ws::topics::Topic;
let topic = Topic::mark_price("BTC-USD");
assert_eq!(topic.to_string(), "BTC-USD@markPrice");Sourcepub fn kline(symbol: impl Into<String>, interval: KlineInterval) -> Self
pub fn kline(symbol: impl Into<String>, interval: KlineInterval) -> Self
Subscribe to kline/candlestick data for a symbol.
§Example
use bullet_rust_sdk::ws::topics::{KlineInterval, Topic};
let topic = Topic::kline("BTC-USD", KlineInterval::H1);
assert_eq!(topic.to_string(), "BTC-USD@kline_1h");Sourcepub fn force_order(symbol: impl Into<String>) -> Self
pub fn force_order(symbol: impl Into<String>) -> Self
Subscribe to liquidation orders for a symbol.
§Example
use bullet_rust_sdk::ws::topics::Topic;
let topic = Topic::force_order("BTC-USD");
assert_eq!(topic.to_string(), "BTC-USD@forceOrder");Sourcepub fn all_tickers() -> Self
pub fn all_tickers() -> Self
Subscribe to mini ticker updates for all symbols.
§Example
use bullet_rust_sdk::ws::topics::Topic;
let topic = Topic::all_tickers();
assert_eq!(topic.to_string(), "!ticker@arr");Sourcepub fn all_mark_prices() -> Self
pub fn all_mark_prices() -> Self
Subscribe to mark price updates for all symbols.
§Example
use bullet_rust_sdk::ws::topics::Topic;
let topic = Topic::all_mark_prices();
assert_eq!(topic.to_string(), "!markPrice@arr");Sourcepub fn all_book_tickers() -> Self
pub fn all_book_tickers() -> Self
Subscribe to book ticker updates for all symbols.
§Example
use bullet_rust_sdk::ws::topics::Topic;
let topic = Topic::all_book_tickers();
assert_eq!(topic.to_string(), "!bookTicker@arr");Sourcepub fn all_force_orders() -> Self
pub fn all_force_orders() -> Self
Subscribe to liquidation orders for all symbols.
§Example
use bullet_rust_sdk::ws::topics::Topic;
let topic = Topic::all_force_orders();
assert_eq!(topic.to_string(), "!forceOrder@arr");Trait Implementations§
impl Eq for Topic
impl StructuralPartialEq for Topic
Auto Trait Implementations§
impl Freeze for Topic
impl RefUnwindSafe for Topic
impl Send for Topic
impl Sync for Topic
impl Unpin for Topic
impl UnsafeUnpin for Topic
impl UnwindSafe for Topic
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.