surrealpatch/tests/common/format.rs

19 lines
321 B
Rust
Raw Normal View History

2024-03-08 10:58:07 +00:00
use std::{fmt, string::ToString};
#[derive(Debug, Copy, Clone)]
pub enum Format {
Json,
Cbor,
Pack,
}
2024-03-08 10:58:07 +00:00
impl fmt::Display for Format {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
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),
}
}
}