#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Frame {
#[prost(message, optional, tag = "1")]
pub command: ::core::option::Option<super::commands::Command>,
#[prost(string, tag = "2")]
pub message_id: ::prost::alloc::string::String,
#[prost(enumeration = "Reliability", tag = "3")]
pub reliability: i32,
#[prost(uint64, tag = "4")]
pub timestamp: u64,
#[prost(map = "string, bytes", tag = "5")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::vec::Vec<u8>,
>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Reliability {
BestEffort = 0,
AtLeastOnce = 1,
ExactlyOnce = 2,
Ordered = 3,
}
impl Reliability {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::BestEffort => "BEST_EFFORT",
Self::AtLeastOnce => "AT_LEAST_ONCE",
Self::ExactlyOnce => "EXACTLY_ONCE",
Self::Ordered => "ORDERED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"BEST_EFFORT" => Some(Self::BestEffort),
"AT_LEAST_ONCE" => Some(Self::AtLeastOnce),
"EXACTLY_ONCE" => Some(Self::ExactlyOnce),
"ORDERED" => Some(Self::Ordered),
_ => None,
}
}
}