2024-01-09 15:27:03 +00:00
|
|
|
use std::string::ToString;
|
|
|
|
|
|
|
|
#[derive(Debug, Copy, Clone)]
|
|
|
|
pub enum Format {
|
|
|
|
Json,
|
2024-01-09 21:50:27 +00:00
|
|
|
Cbor,
|
|
|
|
Pack,
|
2024-01-09 15:27:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl ToString for Format {
|
|
|
|
fn to_string(&self) -> String {
|
|
|
|
match self {
|
|
|
|
Self::Json => "json".to_owned(),
|
2024-01-09 21:50:27 +00:00
|
|
|
Self::Cbor => "cbor".to_owned(),
|
|
|
|
Self::Pack => "msgpack".to_owned(),
|
2024-01-09 15:27:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|