iqengine_plugin/server/
data_type.rs

1#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
2pub enum DataType {
3    #[serde(rename = "iq/ci8_le")]
4    IqSlashCi8Le,
5    #[serde(rename = "iq/ci16_le")]
6    IqSlashCi16Le,
7    #[serde(rename = "iq/cf32_le")]
8    IqSlashCf32Le,
9    #[serde(rename = "image/png")]
10    ImageSlashPng,
11    #[serde(rename = "audio/wav")]
12    AudioSlashWav,
13    #[serde(rename = "application/octet-stream")]
14    ApplicationSlashOctetStream,
15    #[serde(rename = "text/plain")]
16    TextSlashPlain,
17}
18
19impl ToString for DataType {
20    fn to_string(&self) -> String {
21        match self {
22            Self::IqSlashCi8Le => String::from("iq/ci8_le"),
23            Self::IqSlashCi16Le => String::from("iq/ci16_le"),
24            Self::IqSlashCf32Le => String::from("iq/cf32_le"),
25            Self::ImageSlashPng => String::from("image/png"),
26            Self::AudioSlashWav => String::from("audio/wav"),
27            Self::ApplicationSlashOctetStream => String::from("application/octet-stream"),
28            Self::TextSlashPlain => String::from("text/plain"),
29        }
30    }
31}
32
33impl Default for DataType {
34    fn default() -> DataType {
35        Self::IqSlashCi8Le
36    }
37}