object_transfer/
enum.rs

1#[cfg(test)]
2use ::std::string::ToString;
3
4/// Supported message serialization/deserialization formats.
5/// Note that the structure to be serialized / deserialized must implement
6/// [`serde::Serialize`] and [`serde::Deserialize`].
7#[derive(Debug, Clone, Copy)]
8pub enum Format {
9  /// MessagePack serialization format.
10  MessagePack,
11  /// JSON serialization format.
12  JSON,
13}
14
15#[cfg(test)]
16impl ToString for Format {
17  fn to_string(&self) -> String {
18    return match self {
19      Format::MessagePack => "MessagePack",
20      Format::JSON => "JSON",
21    }
22    .to_string();
23  }
24}