zbus_lib/rpc/
protocol.rs

1pub struct Protocol;
2
3impl Protocol {
4    //Parameter keys(Message main key-value pairs)
5    pub(crate) const CMD: &'static str = "cmd";
6    // Request message command
7    const STATUS: &'static str = "status";
8    // Response message status
9    pub(crate) const ID: &'static str = "id";
10    // Message ID
11    const BODY: &'static str = "body";
12    // Message body
13    const API_KEY: &'static str = "apiKey";
14    // Authentication  Key
15    const SIGNATURE: &'static str = "signature"; // Authentication signature generated
16
17    //Command values(key=cmd)
18    const PUB: &'static str = "pub";
19    //Publish message
20    pub(crate) const SUB: &'static str = "sub";
21    //Subscribe message stream
22    const TAKE: &'static str = "take";
23    //One-time read message from MQ
24    pub(crate) const ROUTE: &'static str = "route";
25    //Route message to specified sender client
26    pub(crate) const CREATE: &'static str = "create";
27    //Create or Update
28    const REMOVE: &'static str = "remove";
29    //Remove MQ/Channel
30    const QUERY: &'static str = "query";
31    //Query MQ/Channel
32    const PING: &'static str = "ping";     //Heartbeat ping
33
34    pub(crate) const MQ: &'static str = "mq";
35    pub(crate) const CHANNEL: &'static str = "channel";
36    const FILTER: &'static str = "filter";
37    //Filter on message's tag
38    const TAG: &'static str = "tag";
39    //Tag of message, if filter applied
40    const OFFSET: &'static str = "offset";
41    const CHECKSUM: &'static str = "checksum";
42    //Offset checksum
43    pub(crate) const SOURCE: &'static str = "source";
44    //message's source id(socket)
45    pub(crate) const TARGET: &'static str = "target";
46    //route message's target id(socket)
47    pub(crate) const MQ_TYPE: &'static str = "mqType";
48    pub(crate) const MQ_MASK: &'static str = "mqMask";
49    const CHANNEL_MASK: &'static str = "channelMask";
50    const WINDOW: &'static str = "window";
51    const ACK: &'static str = "ack";
52    pub(crate) const MEMORY: &'static str = "memory";
53
54    pub(crate) const MASK_DELETE_ON_EXIT: i32 = 1 << 0;
55    const MASK_EXCLUSIVE: i32 = 1 << 1;
56    const MASK_TAKEOVER: i32 = 1 << 2;   //NOT support yet
57}