use super::Lse;
use crate::{
Identifier,
subscription::{Subscription, book::OrderBooksL1, trade::PublicTrades},
};
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum LseChannel {
Tick,
}
impl AsRef<str> for LseChannel {
fn as_ref(&self) -> &str {
match self {
Self::Tick => "tick",
}
}
}
impl<Server, Instrument> Identifier<LseChannel>
for Subscription<Lse<Server>, Instrument, PublicTrades>
{
fn id(&self) -> LseChannel {
LseChannel::Tick
}
}
impl<Server, Instrument> Identifier<LseChannel>
for Subscription<Lse<Server>, Instrument, OrderBooksL1>
{
fn id(&self) -> LseChannel {
LseChannel::Tick
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_channel_as_ref() {
assert_eq!(LseChannel::Tick.as_ref(), "tick");
}
}