barter_data/exchange/bybit/
channel.rs1use crate::{
2 Identifier,
3 exchange::bybit::Bybit,
4 subscription::{Subscription, trade::PublicTrades},
5};
6use serde::Serialize;
7
8#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Serialize)]
13pub struct BybitChannel(pub &'static str);
14
15impl BybitChannel {
16 pub const TRADES: Self = Self("publicTrade");
20}
21
22impl<Server, Instrument> Identifier<BybitChannel>
23 for Subscription<Bybit<Server>, Instrument, PublicTrades>
24{
25 fn id(&self) -> BybitChannel {
26 BybitChannel::TRADES
27 }
28}
29
30impl AsRef<str> for BybitChannel {
31 fn as_ref(&self) -> &str {
32 self.0
33 }
34}