1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use super::Gateio;
use crate::{subscription::Subscription, Identifier};
use serde::{Deserialize, Serialize};
#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Deserialize, Serialize)]
pub struct GateioMarket(pub String);
impl<Server, Kind> Identifier<GateioMarket> for Subscription<Gateio<Server>, Kind> {
fn id(&self) -> GateioMarket {
GateioMarket(format!("{}_{}", self.instrument.base, self.instrument.quote).to_uppercase())
}
}
impl AsRef<str> for GateioMarket {
fn as_ref(&self) -> &str {
&self.0
}
}