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    /// Required logical table namespace. Tables share the node and peer listener
112    /// while isolating their key, cache, query, and durable storage state.
113    #[prost(string, tag = "10")]
114    pub table: ::prost::alloc::string::String,
115    #[prost(oneof = "request::Operation", tags = "2, 3, 4, 5, 6, 7, 8, 9")]
116    pub operation: ::core::option::Option<request::Operation>,
117}
118/// Nested message and enum types in `Request`.
119pub mod request {
120    #[derive(Clone, PartialEq, ::prost::Oneof)]
121    pub enum Operation {
122        #[prost(message, tag = "2")]
123        Get(super::Get),
124        #[prost(message, tag = "3")]
125        Put(super::Put),
126        #[prost(message, tag = "4")]
127        Delete(super::Delete),
128        #[prost(message, tag = "5")]
129        BatchGet(super::BatchGet),
130        #[prost(message, tag = "6")]
131        BatchPut(super::BatchPut),
132        #[prost(message, tag = "7")]
133        Query(super::Query),
134        #[prost(message, tag = "8")]
135        Inspect(super::Inspect),
136        #[prost(message, tag = "9")]
137        Scan(super::Scan),
138    }
139}
140#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
141pub struct Error {
142    #[prost(enumeration = "ErrorCode", tag = "1")]
143    pub code: i32,
144    #[prost(string, tag = "2")]
145    pub message: ::prost::alloc::string::String,
146    #[prost(uint64, tag = "3")]
147    pub winner_timestamp_ms: u64,
148    #[prost(string, tag = "4")]
149    pub winner_node_id: ::prost::alloc::string::String,
150    #[prost(bool, tag = "5")]
151    pub winner_is_tombstone: bool,
152    #[prost(uint64, tag = "6")]
153    pub winner_logical_counter: u64,
154}
155#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
156pub struct Value {
157    #[prost(bytes = "vec", tag = "1")]
158    pub bytes: ::prost::alloc::vec::Vec<u8>,
159    #[prost(uint64, tag = "2")]
160    pub timestamp_ms: u64,
161    #[prost(string, tag = "3")]
162    pub node_id: ::prost::alloc::string::String,
163    #[prost(uint64, optional, tag = "4")]
164    pub expires_at_ms: ::core::option::Option<u64>,
165    #[prost(uint64, tag = "5")]
166    pub logical_counter: u64,
167}
168#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
169pub struct ReadResult {
170    #[prost(string, tag = "1")]
171    pub key: ::prost::alloc::string::String,
172    #[prost(message, optional, tag = "2")]
173    pub value: ::core::option::Option<Value>,
174    #[prost(message, optional, tag = "3")]
175    pub error: ::core::option::Option<Error>,
176}
177#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
178pub struct MutationResult {
179    #[prost(string, tag = "1")]
180    pub key: ::prost::alloc::string::String,
181    #[prost(message, optional, tag = "2")]
182    pub error: ::core::option::Option<Error>,
183    #[prost(bytes = "vec", optional, tag = "3")]
184    pub write_concern: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
185}
186#[derive(Clone, PartialEq, ::prost::Message)]
187pub struct QueryResult {
188    #[prost(string, repeated, tag = "1")]
189    pub columns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
190    #[prost(message, repeated, tag = "2")]
191    pub rows: ::prost::alloc::vec::Vec<super::meta::QueryPageRow>,
192}
193#[derive(Clone, PartialEq, ::prost::Message)]
194pub struct FragmentHealth {
195    #[prost(uint32, tag = "1")]
196    pub fragment: u32,
197    #[prost(uint64, tag = "2")]
198    pub worker_count: u64,
199    #[prost(string, repeated, tag = "3")]
200    pub worker_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
201    #[prost(map = "string, uint64", tag = "4")]
202    pub restarts: ::std::collections::HashMap<::prost::alloc::string::String, u64>,
203    #[prost(uint64, tag = "5")]
204    pub last_reaped: u64,
205    #[prost(uint64, tag = "6")]
206    pub shed_high: u64,
207    #[prost(uint64, tag = "7")]
208    pub shed_default: u64,
209    #[prost(uint64, tag = "8")]
210    pub shed_background: u64,
211}
212#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
213pub struct Placement {
214    #[prost(uint32, tag = "1")]
215    pub fragment: u32,
216    #[prost(string, repeated, tag = "2")]
217    pub replica_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
218    #[prost(string, tag = "3")]
219    pub state: ::prost::alloc::string::String,
220}
221#[derive(Clone, PartialEq, ::prost::Message)]
222pub struct Inspection {
223    #[prost(string, tag = "1")]
224    pub node_id: ::prost::alloc::string::String,
225    #[prost(string, tag = "2")]
226    pub peer_addr: ::prost::alloc::string::String,
227    #[prost(uint64, tag = "3")]
228    pub peer_count: u64,
229    #[prost(message, repeated, tag = "4")]
230    pub health: ::prost::alloc::vec::Vec<FragmentHealth>,
231    #[prost(message, repeated, tag = "5")]
232    pub placement: ::prost::alloc::vec::Vec<Placement>,
233    #[prost(bool, tag = "6")]
234    pub dynamic: bool,
235}
236#[derive(Clone, PartialEq, ::prost::Message)]
237pub struct Response {
238    #[prost(uint64, tag = "1")]
239    pub id: u64,
240    #[prost(message, optional, tag = "2")]
241    pub error: ::core::option::Option<Error>,
242    #[prost(message, repeated, tag = "3")]
243    pub reads: ::prost::alloc::vec::Vec<ReadResult>,
244    #[prost(message, repeated, tag = "4")]
245    pub mutations: ::prost::alloc::vec::Vec<MutationResult>,
246    #[prost(message, optional, tag = "5")]
247    pub query: ::core::option::Option<QueryResult>,
248    #[prost(message, optional, tag = "6")]
249    pub inspection: ::core::option::Option<Inspection>,
250    #[prost(message, repeated, tag = "7")]
251    pub scans: ::prost::alloc::vec::Vec<super::meta::ScanMatch>,
252}
253#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
254#[repr(i32)]
255pub enum ErrorCode {
256    Unknown = 0,
257    Invalid = 1,
258    Backpressure = 2,
259    Storage = 3,
260    Unavailable = 4,
261    Superseded = 5,
262    Expired = 6,
263    ShuttingDown = 7,
264    Query = 8,
265    Unsupported = 9,
266    ResourceLimit = 10,
267    UnknownOutcome = 11,
268    QueryChanged = 12,
269}
270impl ErrorCode {
271    /// String value of the enum field names used in the ProtoBuf definition.
272    ///
273    /// The values are not transformed in any way and thus are considered stable
274    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
275    pub fn as_str_name(&self) -> &'static str {
276        match self {
277            Self::Unknown => "ERROR_CODE_UNKNOWN",
278            Self::Invalid => "ERROR_CODE_INVALID",
279            Self::Backpressure => "ERROR_CODE_BACKPRESSURE",
280            Self::Storage => "ERROR_CODE_STORAGE",
281            Self::Unavailable => "ERROR_CODE_UNAVAILABLE",
282            Self::Superseded => "ERROR_CODE_SUPERSEDED",
283            Self::Expired => "ERROR_CODE_EXPIRED",
284            Self::ShuttingDown => "ERROR_CODE_SHUTTING_DOWN",
285            Self::Query => "ERROR_CODE_QUERY",
286            Self::Unsupported => "ERROR_CODE_UNSUPPORTED",
287            Self::ResourceLimit => "ERROR_CODE_RESOURCE_LIMIT",
288            Self::UnknownOutcome => "ERROR_CODE_UNKNOWN_OUTCOME",
289            Self::QueryChanged => "ERROR_CODE_QUERY_CHANGED",
290        }
291    }
292    /// Creates an enum from field names used in the ProtoBuf definition.
293    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
294        match value {
295            "ERROR_CODE_UNKNOWN" => Some(Self::Unknown),
296            "ERROR_CODE_INVALID" => Some(Self::Invalid),
297            "ERROR_CODE_BACKPRESSURE" => Some(Self::Backpressure),
298            "ERROR_CODE_STORAGE" => Some(Self::Storage),
299            "ERROR_CODE_UNAVAILABLE" => Some(Self::Unavailable),
300            "ERROR_CODE_SUPERSEDED" => Some(Self::Superseded),
301            "ERROR_CODE_EXPIRED" => Some(Self::Expired),
302            "ERROR_CODE_SHUTTING_DOWN" => Some(Self::ShuttingDown),
303            "ERROR_CODE_QUERY" => Some(Self::Query),
304            "ERROR_CODE_UNSUPPORTED" => Some(Self::Unsupported),
305            "ERROR_CODE_RESOURCE_LIMIT" => Some(Self::ResourceLimit),
306            "ERROR_CODE_UNKNOWN_OUTCOME" => Some(Self::UnknownOutcome),
307            "ERROR_CODE_QUERY_CHANGED" => Some(Self::QueryChanged),
308            _ => None,
309        }
310    }
311}