2024-03-08 10:58:07 +00:00
|
|
|
use std::{fmt, string::ToString};
|
2024-01-09 15:27:03 +00:00
|
|
|
|
|
|
|
#[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
|
|
|
}
|
|
|
|
|
2024-03-08 10:58:07 +00:00
|
|
|
impl fmt::Display for Format {
|
|
|
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
2024-01-09 15:27:03 +00:00
|
|
|
match self {
|
2024-03-08 10:58:07 +00:00
|
|
|
Self::Json => "json".fmt(f),
|
|
|
|
Self::Cbor => "cbor".fmt(f),
|
|
|
|
Self::Pack => "msgpack".fmt(f),
|
2024-01-09 15:27:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|