deribit_websocket/
subscriptions.rs1use std::fmt;
4
5#[derive(Debug, Clone)]
7pub enum SubscriptionChannel {
8 Ticker(String),
10 OrderBook(String),
12 Trades(String),
14 UserOrders,
16 UserTrades,
18}
19
20impl fmt::Display for SubscriptionChannel {
21 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
22 let channel_str = match self {
23 Self::Ticker(instrument) => format!("ticker.{instrument}.raw"),
24 Self::OrderBook(instrument) => format!("book.{instrument}.raw"),
25 Self::Trades(instrument) => format!("trades.{instrument}.raw"),
26 Self::UserOrders => "user.orders.any.any.raw".to_string(),
27 Self::UserTrades => "user.trades.any.any.raw".to_string(),
28 };
29 write!(f, "{channel_str}")
30 }
31}