surrealpatch/tests/common/format.rs
Tobie Morgan Hitchcock f7e6e028a2
Support CBOR and MessagePack binary serialisation in WebSocket (#3251)
Co-authored-by: Rushmore Mushambi <rushmore@surrealdb.com>
2024-01-09 21:50:27 +00:00

18 lines
295 B
Rust

use std::string::ToString;
#[derive(Debug, Copy, Clone)]
pub enum Format {
Json,
Cbor,
Pack,
}
impl ToString for Format {
fn to_string(&self) -> String {
match self {
Self::Json => "json".to_owned(),
Self::Cbor => "cbor".to_owned(),
Self::Pack => "msgpack".to_owned(),
}
}
}