Skip to main content

actordb_protocol/generated/
client.rs

1// This file is @generated by prost-build.
2/// Application protocol, independent of the peer mesh version and credentials.
3#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4pub struct Hello {
5    #[prost(string, tag = "1")]
6    pub identity: ::prost::alloc::string::String,
7    #[prost(bytes = "vec", tag = "2")]
8    pub challenge: ::prost::alloc::vec::Vec<u8>,
9    #[prost(uint32, tag = "3")]
10    pub min_version: u32,
11    #[prost(uint32, tag = "4")]
12    pub max_version: u32,
13    #[prost(uint64, tag = "5")]
14    pub capabilities: u64,
15}
16#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
17pub struct Auth {
18    #[prost(bytes = "vec", tag = "1")]
19    pub proof: ::prost::alloc::vec::Vec<u8>,
20}
21#[derive(Clone, PartialEq, ::prost::Message)]
22pub struct Frame {
23    #[prost(oneof = "frame::Message", tags = "1, 2, 3, 4")]
24    pub message: ::core::option::Option<frame::Message>,
25}
26/// Nested message and enum types in `Frame`.
27pub mod frame {
28    #[derive(Clone, PartialEq, ::prost::Oneof)]
29    pub enum Message {
30        #[prost(message, tag = "1")]
31        Hello(super::Hello),
32        #[prost(message, tag = "2")]
33        Auth(super::Auth),
34        #[prost(message, tag = "3")]
35        Request(super::Request),
36        #[prost(message, tag = "4")]
37        Response(super::Response),
38    }
39}
40#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
41pub struct Get {
42    #[prost(string, tag = "1")]
43    pub key: ::prost::alloc::string::String,
44    #[prost(enumeration = "super::meta::Priority", tag = "2")]
45    pub priority: i32,
46}
47#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
48pub struct Put {
49    #[prost(string, tag = "1")]
50    pub key: ::prost::alloc::string::String,
51    #[prost(bytes = "vec", tag = "2")]
52    pub value: ::prost::alloc::vec::Vec<u8>,
53    #[prost(uint64, optional, tag = "3")]
54    pub ttl_ms: ::core::option::Option<u64>,
55    #[prost(enumeration = "super::meta::Priority", tag = "4")]
56    pub priority: i32,
57    #[prost(bytes = "vec", optional, tag = "5")]
58    pub write_concern: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
59}
60#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
61pub struct Delete {
62    #[prost(string, tag = "1")]
63    pub key: ::prost::alloc::string::String,
64    #[prost(enumeration = "super::meta::Priority", tag = "2")]
65    pub priority: i32,
66    #[prost(bytes = "vec", optional, tag = "3")]
67    pub write_concern: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
68}
69#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
70pub struct BatchGet {
71    #[prost(string, repeated, tag = "1")]
72    pub keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
73    #[prost(enumeration = "super::meta::Priority", tag = "2")]
74    pub priority: i32,
75}
76#[derive(Clone, PartialEq, ::prost::Message)]
77pub struct BatchPut {
78    #[prost(message, repeated, tag = "1")]
79    pub puts: ::prost::alloc::vec::Vec<Put>,
80    #[prost(enumeration = "super::meta::Priority", tag = "2")]
81    pub priority: i32,
82}
83#[derive(Clone, PartialEq, ::prost::Message)]
84pub struct Query {
85    #[prost(string, tag = "1")]
86    pub sql: ::prost::alloc::string::String,
87    #[prost(message, repeated, tag = "2")]
88    pub params: ::prost::alloc::vec::Vec<super::meta::QueryCell>,
89}
90#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
91pub struct Inspect {}
92#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
93pub struct Scan {
94    #[prost(uint32, tag = "1")]
95    pub matcher_kind: u32,
96    #[prost(bytes = "vec", tag = "2")]
97    pub prefix: ::prost::alloc::vec::Vec<u8>,
98    #[prost(uint32, tag = "3")]
99    pub transform_kind: u32,
100    #[prost(uint32, tag = "4")]
101    pub prefix_bytes: u32,
102    #[prost(uint32, tag = "5")]
103    pub limit: u32,
104    #[prost(uint64, tag = "6")]
105    pub offset: u64,
106}
107#[derive(Clone, PartialEq, ::prost::Message)]
108pub struct Request {
109    #[prost(uint64, tag = "1")]
110    pub id: u64,
111    #[prost(oneof = "request::Operation", tags = "2, 3, 4, 5, 6, 7, 8, 9")]
112    pub operation: ::core::option::Option<request::Operation>,
113}
114/// Nested message and enum types in `Request`.
115pub mod request {
116    #[derive(Clone, PartialEq, ::prost::Oneof)]
117    pub enum Operation {
118        #[prost(message, tag = "2")]
119        Get(super::Get),
120        #[prost(message, tag = "3")]
121        Put(super::Put),
122        #[prost(message, tag = "4")]
123        Delete(super::Delete),
124        #[prost(message, tag = "5")]
125        BatchGet(super::BatchGet),
126        #[prost(message, tag = "6")]
127        BatchPut(super::BatchPut),
128        #[prost(message, tag = "7")]
129        Query(super::Query),
130        #[prost(message, tag = "8")]
131        Inspect(super::Inspect),
132        #[prost(message, tag = "9")]
133        Scan(super::Scan),
134    }
135}
136#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
137pub struct Error {
138    #[prost(enumeration = "ErrorCode", tag = "1")]
139    pub code: i32,
140    #[prost(string, tag = "2")]
141    pub message: ::prost::alloc::string::String,
142    #[prost(uint64, tag = "3")]
143    pub winner_timestamp_ms: u64,
144    #[prost(string, tag = "4")]
145    pub winner_node_id: ::prost::alloc::string::String,
146    #[prost(bool, tag = "5")]
147    pub winner_is_tombstone: bool,
148}
149#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
150pub struct Value {
151    #[prost(bytes = "vec", tag = "1")]
152    pub bytes: ::prost::alloc::vec::Vec<u8>,
153    #[prost(uint64, tag = "2")]
154    pub timestamp_ms: u64,
155    #[prost(string, tag = "3")]
156    pub node_id: ::prost::alloc::string::String,
157    #[prost(uint64, optional, tag = "4")]
158    pub expires_at_ms: ::core::option::Option<u64>,
159}
160#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
161pub struct ReadResult {
162    #[prost(string, tag = "1")]
163    pub key: ::prost::alloc::string::String,
164    #[prost(message, optional, tag = "2")]
165    pub value: ::core::option::Option<Value>,
166    #[prost(message, optional, tag = "3")]
167    pub error: ::core::option::Option<Error>,
168}
169#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
170pub struct MutationResult {
171    #[prost(string, tag = "1")]
172    pub key: ::prost::alloc::string::String,
173    #[prost(message, optional, tag = "2")]
174    pub error: ::core::option::Option<Error>,
175    #[prost(bytes = "vec", optional, tag = "3")]
176    pub write_concern: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
177}
178#[derive(Clone, PartialEq, ::prost::Message)]
179pub struct QueryResult {
180    #[prost(string, repeated, tag = "1")]
181    pub columns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
182    #[prost(message, repeated, tag = "2")]
183    pub rows: ::prost::alloc::vec::Vec<super::meta::QueryPageRow>,
184}
185#[derive(Clone, PartialEq, ::prost::Message)]
186pub struct FragmentHealth {
187    #[prost(uint32, tag = "1")]
188    pub fragment: u32,
189    #[prost(uint64, tag = "2")]
190    pub worker_count: u64,
191    #[prost(string, repeated, tag = "3")]
192    pub worker_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
193    #[prost(map = "string, uint64", tag = "4")]
194    pub restarts: ::std::collections::HashMap<::prost::alloc::string::String, u64>,
195    #[prost(uint64, tag = "5")]
196    pub last_reaped: u64,
197    #[prost(uint64, tag = "6")]
198    pub shed_high: u64,
199    #[prost(uint64, tag = "7")]
200    pub shed_default: u64,
201    #[prost(uint64, tag = "8")]
202    pub shed_background: u64,
203}
204#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
205pub struct Placement {
206    #[prost(uint32, tag = "1")]
207    pub fragment: u32,
208    #[prost(string, repeated, tag = "2")]
209    pub replica_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
210    #[prost(string, tag = "3")]
211    pub state: ::prost::alloc::string::String,
212}
213#[derive(Clone, PartialEq, ::prost::Message)]
214pub struct Inspection {
215    #[prost(string, tag = "1")]
216    pub node_id: ::prost::alloc::string::String,
217    #[prost(string, tag = "2")]
218    pub peer_addr: ::prost::alloc::string::String,
219    #[prost(uint64, tag = "3")]
220    pub peer_count: u64,
221    #[prost(message, repeated, tag = "4")]
222    pub health: ::prost::alloc::vec::Vec<FragmentHealth>,
223    #[prost(message, repeated, tag = "5")]
224    pub placement: ::prost::alloc::vec::Vec<Placement>,
225    #[prost(bool, tag = "6")]
226    pub dynamic: bool,
227}
228#[derive(Clone, PartialEq, ::prost::Message)]
229pub struct Response {
230    #[prost(uint64, tag = "1")]
231    pub id: u64,
232    #[prost(message, optional, tag = "2")]
233    pub error: ::core::option::Option<Error>,
234    #[prost(message, repeated, tag = "3")]
235    pub reads: ::prost::alloc::vec::Vec<ReadResult>,
236    #[prost(message, repeated, tag = "4")]
237    pub mutations: ::prost::alloc::vec::Vec<MutationResult>,
238    #[prost(message, optional, tag = "5")]
239    pub query: ::core::option::Option<QueryResult>,
240    #[prost(message, optional, tag = "6")]
241    pub inspection: ::core::option::Option<Inspection>,
242    #[prost(message, repeated, tag = "7")]
243    pub scans: ::prost::alloc::vec::Vec<super::meta::ScanMatch>,
244}
245#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
246#[repr(i32)]
247pub enum ErrorCode {
248    Unknown = 0,
249    Invalid = 1,
250    Backpressure = 2,
251    Storage = 3,
252    Unavailable = 4,
253    Superseded = 5,
254    Expired = 6,
255    ShuttingDown = 7,
256    Query = 8,
257    Unsupported = 9,
258    ResourceLimit = 10,
259    UnknownOutcome = 11,
260    QueryChanged = 12,
261}
262impl ErrorCode {
263    /// String value of the enum field names used in the ProtoBuf definition.
264    ///
265    /// The values are not transformed in any way and thus are considered stable
266    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
267    pub fn as_str_name(&self) -> &'static str {
268        match self {
269            Self::Unknown => "ERROR_CODE_UNKNOWN",
270            Self::Invalid => "ERROR_CODE_INVALID",
271            Self::Backpressure => "ERROR_CODE_BACKPRESSURE",
272            Self::Storage => "ERROR_CODE_STORAGE",
273            Self::Unavailable => "ERROR_CODE_UNAVAILABLE",
274            Self::Superseded => "ERROR_CODE_SUPERSEDED",
275            Self::Expired => "ERROR_CODE_EXPIRED",
276            Self::ShuttingDown => "ERROR_CODE_SHUTTING_DOWN",
277            Self::Query => "ERROR_CODE_QUERY",
278            Self::Unsupported => "ERROR_CODE_UNSUPPORTED",
279            Self::ResourceLimit => "ERROR_CODE_RESOURCE_LIMIT",
280            Self::UnknownOutcome => "ERROR_CODE_UNKNOWN_OUTCOME",
281            Self::QueryChanged => "ERROR_CODE_QUERY_CHANGED",
282        }
283    }
284    /// Creates an enum from field names used in the ProtoBuf definition.
285    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
286        match value {
287            "ERROR_CODE_UNKNOWN" => Some(Self::Unknown),
288            "ERROR_CODE_INVALID" => Some(Self::Invalid),
289            "ERROR_CODE_BACKPRESSURE" => Some(Self::Backpressure),
290            "ERROR_CODE_STORAGE" => Some(Self::Storage),
291            "ERROR_CODE_UNAVAILABLE" => Some(Self::Unavailable),
292            "ERROR_CODE_SUPERSEDED" => Some(Self::Superseded),
293            "ERROR_CODE_EXPIRED" => Some(Self::Expired),
294            "ERROR_CODE_SHUTTING_DOWN" => Some(Self::ShuttingDown),
295            "ERROR_CODE_QUERY" => Some(Self::Query),
296            "ERROR_CODE_UNSUPPORTED" => Some(Self::Unsupported),
297            "ERROR_CODE_RESOURCE_LIMIT" => Some(Self::ResourceLimit),
298            "ERROR_CODE_UNKNOWN_OUTCOME" => Some(Self::UnknownOutcome),
299            "ERROR_CODE_QUERY_CHANGED" => Some(Self::QueryChanged),
300            _ => None,
301        }
302    }
303}