zmk_protocol/proto/
zmk.meta.rs1#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct Response {
5 #[prost(oneof="response::ResponseType", tags="1, 2")]
6 pub response_type: ::core::option::Option<response::ResponseType>,
7}
8pub mod response {
10 #[allow(clippy::derive_partial_eq_without_eq)]
11#[derive(Clone, PartialEq, ::prost::Oneof)]
12 pub enum ResponseType {
13 #[prost(bool, tag="1")]
14 NoResponse(bool),
15 #[prost(enumeration="super::ErrorConditions", tag="2")]
16 SimpleError(i32),
17 }
18}
19#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
20#[repr(i32)]
21pub enum ErrorConditions {
22 Generic = 0,
23 UnlockRequired = 1,
24 RpcNotFound = 2,
25 MsgDecodeFailed = 3,
26 MsgEncodeFailed = 4,
27}
28impl ErrorConditions {
29 pub fn as_str_name(&self) -> &'static str {
34 match self {
35 ErrorConditions::Generic => "GENERIC",
36 ErrorConditions::UnlockRequired => "UNLOCK_REQUIRED",
37 ErrorConditions::RpcNotFound => "RPC_NOT_FOUND",
38 ErrorConditions::MsgDecodeFailed => "MSG_DECODE_FAILED",
39 ErrorConditions::MsgEncodeFailed => "MSG_ENCODE_FAILED",
40 }
41 }
42 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
44 match value {
45 "GENERIC" => Some(Self::Generic),
46 "UNLOCK_REQUIRED" => Some(Self::UnlockRequired),
47 "RPC_NOT_FOUND" => Some(Self::RpcNotFound),
48 "MSG_DECODE_FAILED" => Some(Self::MsgDecodeFailed),
49 "MSG_ENCODE_FAILED" => Some(Self::MsgEncodeFailed),
50 _ => None,
51 }
52 }
53}
54