1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
/// The main libqaul RPC message container.
/// All RPC messages from and to libqaul are packed
/// into this container.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QaulRpc {
/// which module to approach
#[prost(enumeration="Modules", tag="1")]
pub module: i32,
/// can be used to identify responses
#[prost(string, tag="2")]
pub request_id: ::prost::alloc::string::String,
/// authorisation
/// binary user id
#[prost(bytes="vec", tag="3")]
pub user_id: ::prost::alloc::vec::Vec<u8>,
/// the protobuf encoded binary message data
/// which is passed to the module.
#[prost(bytes="vec", tag="4")]
pub data: ::prost::alloc::vec::Vec<u8>,
}
/// Identification to which module the message shall be
/// handed to.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Modules {
/// default value, when nothing is defined.
/// drop this message
None = 0,
/// RPC related messages
/// such as authorisation etc.
Rpc = 1,
/// node information
Node = 2,
/// user accounts on this node
Useraccounts = 3,
/// all users in the network
Users = 4,
/// routing information
Router = 5,
/// feed module handling
///
/// send and retrieve feed messages
Feed = 6,
/// connection information to other nodes
Connections = 7,
/// debug information & settings
Debug = 8,
/// chat group handling
///
/// manage chat groups and group invites
Group = 9,
/// chat module
/// to send chat messages, get a
/// conversation overiew and all
/// messages within a conversation
Chat = 10,
/// all functions to send and manage
/// files sent into a chat conversation
Chatfile = 11,
/// BLE module handling
Ble = 12,
/// Real Time Communication handling
Rtc = 13,
/// Delay Tolerant Networking
Dtn = 14,
}
impl Modules {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Modules::None => "NONE",
Modules::Rpc => "RPC",
Modules::Node => "NODE",
Modules::Useraccounts => "USERACCOUNTS",
Modules::Users => "USERS",
Modules::Router => "ROUTER",
Modules::Feed => "FEED",
Modules::Connections => "CONNECTIONS",
Modules::Debug => "DEBUG",
Modules::Group => "GROUP",
Modules::Chat => "CHAT",
Modules::Chatfile => "CHATFILE",
Modules::Ble => "BLE",
Modules::Rtc => "RTC",
Modules::Dtn => "DTN",
}
}
}