1#![allow(non_camel_case_types, non_snake_case, non_upper_case_globals, unused_crate_dependencies)]
4
5pub use self::consts::*;
6pub use self::errors::*;
7pub use self::types::*;
8
9pub mod consts {
10 lazy_static::lazy_static! {
11 pub static ref kInvalidValueType: crate::types::ValueType = crate::types::ValueType {
12 type_: crate::types::SupportedType::UNKNOWN,
13 value_type: ::std::default::Default::default(),
14 schema: ::std::default::Default::default(),
15 };
16 }
17}
18
19pub mod types {
20 #![allow(clippy::redundant_closure)]
21
22
23 pub type GraphSpaceID = ::std::primitive::i32;
24
25 pub type PartitionID = ::std::primitive::i32;
26
27 pub type TagID = ::std::primitive::i32;
28
29 pub type EdgeType = ::std::primitive::i32;
30
31 pub type EdgeRanking = ::std::primitive::i64;
32
33 pub type VertexID = ::std::primitive::i64;
34
35 pub type IndexID = ::std::primitive::i32;
36
37 pub type IPv4 = ::std::primitive::i32;
38
39 pub type Port = ::std::primitive::i32;
40
41 pub type SchemaVer = ::std::primitive::i64;
42
43 pub type ClusterID = ::std::primitive::i64;
44
45 #[derive(Clone, Debug, PartialEq)]
46 pub struct ValueType {
47 pub type_: crate::types::SupportedType,
48 pub value_type: ::std::option::Option<Box<crate::types::ValueType>>,
49 pub schema: ::std::option::Option<crate::types::Schema>,
50 }
51
52 #[derive(Clone, Debug, PartialEq)]
53 pub enum Value {
54 int_value(::std::primitive::i64),
55 bool_value(::std::primitive::bool),
56 double_value(::std::primitive::f64),
57 string_value(::std::string::String),
58 timestamp(::std::primitive::i64),
59 UnknownField(::std::primitive::i32),
60 }
61
62 #[derive(Clone, Debug, PartialEq)]
63 pub struct ColumnDef {
64 pub name: ::std::string::String,
65 pub type_: crate::types::ValueType,
66 pub default_value: ::std::option::Option<crate::types::Value>,
67 }
68
69 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
70 pub struct SchemaProp {
71 pub ttl_duration: ::std::option::Option<::std::primitive::i64>,
72 pub ttl_col: ::std::option::Option<::std::string::String>,
73 }
74
75 #[derive(Clone, Debug, PartialEq)]
76 pub struct Schema {
77 pub columns: ::std::vec::Vec<crate::types::ColumnDef>,
78 pub schema_prop: crate::types::SchemaProp,
79 }
80
81 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
82 pub enum SchemaID {
83 tag_id(crate::types::TagID),
84 edge_type(crate::types::EdgeType),
85 UnknownField(::std::primitive::i32),
86 }
87
88 #[derive(Clone, Debug, PartialEq)]
89 pub struct IndexItem {
90 pub index_id: crate::types::IndexID,
91 pub index_name: ::std::string::String,
92 pub schema_id: crate::types::SchemaID,
93 pub schema_name: ::std::string::String,
94 pub fields: ::std::vec::Vec<crate::types::ColumnDef>,
95 }
96
97 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
98 pub struct HostAddr {
99 pub ip: crate::types::IPv4,
100 pub port: crate::types::Port,
101 }
102
103 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
104 pub struct Pair {
105 pub key: ::std::string::String,
106 pub value: ::std::string::String,
107 }
108
109 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
110 pub struct RoleItem {
111 pub user: ::std::string::String,
112 pub space_id: crate::types::GraphSpaceID,
113 pub role_type: crate::types::RoleType,
114 }
115
116 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
117 pub struct SupportedType(pub ::std::primitive::i32);
118
119 impl SupportedType {
120 pub const UNKNOWN: Self = SupportedType(0i32);
121 pub const BOOL: Self = SupportedType(1i32);
122 pub const INT: Self = SupportedType(2i32);
123 pub const VID: Self = SupportedType(3i32);
124 pub const FLOAT: Self = SupportedType(4i32);
125 pub const DOUBLE: Self = SupportedType(5i32);
126 pub const STRING: Self = SupportedType(6i32);
127 pub const TIMESTAMP: Self = SupportedType(21i32);
128 pub const YEAR: Self = SupportedType(22i32);
129 pub const YEARMONTH: Self = SupportedType(23i32);
130 pub const DATE: Self = SupportedType(24i32);
131 pub const DATETIME: Self = SupportedType(25i32);
132 pub const PATH: Self = SupportedType(41i32);
133
134 pub fn variants() -> &'static [&'static str] {
135 &[
136 "UNKNOWN",
137 "BOOL",
138 "INT",
139 "VID",
140 "FLOAT",
141 "DOUBLE",
142 "STRING",
143 "TIMESTAMP",
144 "YEAR",
145 "YEARMONTH",
146 "DATE",
147 "DATETIME",
148 "PATH",
149 ]
150 }
151 }
152
153 impl ::std::default::Default for SupportedType {
154 fn default() -> Self {
155 SupportedType(::fbthrift::__UNKNOWN_ID)
156 }
157 }
158
159 impl<'a> ::std::convert::From<&'a SupportedType> for ::std::primitive::i32 {
160 #[inline]
161 fn from(x: &'a SupportedType) -> Self {
162 x.0
163 }
164 }
165
166 impl ::std::convert::From<SupportedType> for ::std::primitive::i32 {
167 #[inline]
168 fn from(x: SupportedType) -> Self {
169 x.0
170 }
171 }
172
173 impl ::std::convert::From<::std::primitive::i32> for SupportedType {
174 #[inline]
175 fn from(x: ::std::primitive::i32) -> Self {
176 Self(x)
177 }
178 }
179
180 impl ::std::fmt::Display for SupportedType {
181 fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
182 let s: &::std::primitive::str = match *self {
183 SupportedType::UNKNOWN => "UNKNOWN",
184 SupportedType::BOOL => "BOOL",
185 SupportedType::INT => "INT",
186 SupportedType::VID => "VID",
187 SupportedType::FLOAT => "FLOAT",
188 SupportedType::DOUBLE => "DOUBLE",
189 SupportedType::STRING => "STRING",
190 SupportedType::TIMESTAMP => "TIMESTAMP",
191 SupportedType::YEAR => "YEAR",
192 SupportedType::YEARMONTH => "YEARMONTH",
193 SupportedType::DATE => "DATE",
194 SupportedType::DATETIME => "DATETIME",
195 SupportedType::PATH => "PATH",
196 SupportedType(x) => return write!(fmt, "{}", x),
197 };
198 write!(fmt, "{}", s)
199 }
200 }
201
202 impl ::std::fmt::Debug for SupportedType {
203 fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
204 write!(fmt, "SupportedType::{}", self)
205 }
206 }
207
208 impl ::std::str::FromStr for SupportedType {
209 type Err = ::anyhow::Error;
210
211 fn from_str(string: &::std::primitive::str) -> ::std::result::Result<Self, Self::Err> {
212 match string {
213 "UNKNOWN" => ::std::result::Result::Ok(SupportedType::UNKNOWN),
214 "BOOL" => ::std::result::Result::Ok(SupportedType::BOOL),
215 "INT" => ::std::result::Result::Ok(SupportedType::INT),
216 "VID" => ::std::result::Result::Ok(SupportedType::VID),
217 "FLOAT" => ::std::result::Result::Ok(SupportedType::FLOAT),
218 "DOUBLE" => ::std::result::Result::Ok(SupportedType::DOUBLE),
219 "STRING" => ::std::result::Result::Ok(SupportedType::STRING),
220 "TIMESTAMP" => ::std::result::Result::Ok(SupportedType::TIMESTAMP),
221 "YEAR" => ::std::result::Result::Ok(SupportedType::YEAR),
222 "YEARMONTH" => ::std::result::Result::Ok(SupportedType::YEARMONTH),
223 "DATE" => ::std::result::Result::Ok(SupportedType::DATE),
224 "DATETIME" => ::std::result::Result::Ok(SupportedType::DATETIME),
225 "PATH" => ::std::result::Result::Ok(SupportedType::PATH),
226 _ => ::anyhow::bail!("Unable to parse {} as SupportedType", string),
227 }
228 }
229 }
230
231 impl ::fbthrift::GetTType for SupportedType {
232 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::I32;
233 }
234
235 impl<P> ::fbthrift::Serialize<P> for SupportedType
236 where
237 P: ::fbthrift::ProtocolWriter,
238 {
239 #[inline]
240 fn write(&self, p: &mut P) {
241 p.write_i32(self.into())
242 }
243 }
244
245 impl<P> ::fbthrift::Deserialize<P> for SupportedType
246 where
247 P: ::fbthrift::ProtocolReader,
248 {
249 #[inline]
250 fn read(p: &mut P) -> ::anyhow::Result<Self> {
251 ::std::result::Result::Ok(SupportedType::from(p.read_i32()?))
252 }
253 }
254
255 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
256 pub struct RoleType(pub ::std::primitive::i32);
257
258 impl RoleType {
259 pub const GOD: Self = RoleType(1i32);
260 pub const ADMIN: Self = RoleType(2i32);
261 pub const DBA: Self = RoleType(3i32);
262 pub const USER: Self = RoleType(4i32);
263 pub const GUEST: Self = RoleType(5i32);
264
265 pub fn variants() -> &'static [&'static str] {
266 &[
267 "GOD",
268 "ADMIN",
269 "DBA",
270 "USER",
271 "GUEST",
272 ]
273 }
274 }
275
276 impl ::std::default::Default for RoleType {
277 fn default() -> Self {
278 RoleType(::fbthrift::__UNKNOWN_ID)
279 }
280 }
281
282 impl<'a> ::std::convert::From<&'a RoleType> for ::std::primitive::i32 {
283 #[inline]
284 fn from(x: &'a RoleType) -> Self {
285 x.0
286 }
287 }
288
289 impl ::std::convert::From<RoleType> for ::std::primitive::i32 {
290 #[inline]
291 fn from(x: RoleType) -> Self {
292 x.0
293 }
294 }
295
296 impl ::std::convert::From<::std::primitive::i32> for RoleType {
297 #[inline]
298 fn from(x: ::std::primitive::i32) -> Self {
299 Self(x)
300 }
301 }
302
303 impl ::std::fmt::Display for RoleType {
304 fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
305 let s: &::std::primitive::str = match *self {
306 RoleType::GOD => "GOD",
307 RoleType::ADMIN => "ADMIN",
308 RoleType::DBA => "DBA",
309 RoleType::USER => "USER",
310 RoleType::GUEST => "GUEST",
311 RoleType(x) => return write!(fmt, "{}", x),
312 };
313 write!(fmt, "{}", s)
314 }
315 }
316
317 impl ::std::fmt::Debug for RoleType {
318 fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
319 write!(fmt, "RoleType::{}", self)
320 }
321 }
322
323 impl ::std::str::FromStr for RoleType {
324 type Err = ::anyhow::Error;
325
326 fn from_str(string: &::std::primitive::str) -> ::std::result::Result<Self, Self::Err> {
327 match string {
328 "GOD" => ::std::result::Result::Ok(RoleType::GOD),
329 "ADMIN" => ::std::result::Result::Ok(RoleType::ADMIN),
330 "DBA" => ::std::result::Result::Ok(RoleType::DBA),
331 "USER" => ::std::result::Result::Ok(RoleType::USER),
332 "GUEST" => ::std::result::Result::Ok(RoleType::GUEST),
333 _ => ::anyhow::bail!("Unable to parse {} as RoleType", string),
334 }
335 }
336 }
337
338 impl ::fbthrift::GetTType for RoleType {
339 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::I32;
340 }
341
342 impl<P> ::fbthrift::Serialize<P> for RoleType
343 where
344 P: ::fbthrift::ProtocolWriter,
345 {
346 #[inline]
347 fn write(&self, p: &mut P) {
348 p.write_i32(self.into())
349 }
350 }
351
352 impl<P> ::fbthrift::Deserialize<P> for RoleType
353 where
354 P: ::fbthrift::ProtocolReader,
355 {
356 #[inline]
357 fn read(p: &mut P) -> ::anyhow::Result<Self> {
358 ::std::result::Result::Ok(RoleType::from(p.read_i32()?))
359 }
360 }
361
362
363
364
365
366
367
368
369
370
371
372
373 impl ::std::default::Default for self::ValueType {
374 fn default() -> Self {
375 Self {
376 type_: ::std::default::Default::default(),
377 value_type: ::std::option::Option::None,
378 schema: ::std::option::Option::None,
379 }
380 }
381 }
382
383 unsafe impl ::std::marker::Send for self::ValueType {}
384 unsafe impl ::std::marker::Sync for self::ValueType {}
385
386 impl ::fbthrift::GetTType for self::ValueType {
387 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
388 }
389
390 impl<P> ::fbthrift::Serialize<P> for self::ValueType
391 where
392 P: ::fbthrift::ProtocolWriter,
393 {
394 fn write(&self, p: &mut P) {
395 p.write_struct_begin("ValueType");
396 p.write_field_begin("type", ::fbthrift::TType::I32, 1);
397 ::fbthrift::Serialize::write(&self.type_, p);
398 p.write_field_end();
399 if let ::std::option::Option::Some(some) = &self.value_type {
400 p.write_field_begin("value_type", ::fbthrift::TType::Struct, 2);
401 ::fbthrift::Serialize::write(some, p);
402 p.write_field_end();
403 }
404 if let ::std::option::Option::Some(some) = &self.schema {
405 p.write_field_begin("schema", ::fbthrift::TType::Struct, 3);
406 ::fbthrift::Serialize::write(some, p);
407 p.write_field_end();
408 }
409 p.write_field_stop();
410 p.write_struct_end();
411 }
412 }
413
414 impl<P> ::fbthrift::Deserialize<P> for self::ValueType
415 where
416 P: ::fbthrift::ProtocolReader,
417 {
418 fn read(p: &mut P) -> ::anyhow::Result<Self> {
419 let mut field_type = ::std::option::Option::None;
420 let mut field_value_type = ::std::option::Option::None;
421 let mut field_schema = ::std::option::Option::None;
422 let _ = p.read_struct_begin(|_| ())?;
423 loop {
424 let (_, fty, fid) = p.read_field_begin(|_| ())?;
425 match (fty, fid as ::std::primitive::i32) {
426 (::fbthrift::TType::Stop, _) => break,
427 (::fbthrift::TType::I32, 1) => field_type = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
428 (::fbthrift::TType::Struct, 2) => field_value_type = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
429 (::fbthrift::TType::Struct, 3) => field_schema = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
430 (fty, _) => p.skip(fty)?,
431 }
432 p.read_field_end()?;
433 }
434 p.read_struct_end()?;
435 ::std::result::Result::Ok(Self {
436 type_: field_type.unwrap_or_default(),
437 value_type: field_value_type,
438 schema: field_schema,
439 })
440 }
441 }
442
443
444
445 impl ::std::default::Default for Value {
446 fn default() -> Self {
447 Self::UnknownField(-1)
448 }
449 }
450
451 impl ::fbthrift::GetTType for Value {
452 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
453 }
454
455 impl<P> ::fbthrift::Serialize<P> for Value
456 where
457 P: ::fbthrift::ProtocolWriter,
458 {
459 fn write(&self, p: &mut P) {
460 p.write_struct_begin("Value");
461 match self {
462 Value::int_value(inner) => {
463 p.write_field_begin("int_value", ::fbthrift::TType::I64, 1);
464 ::fbthrift::Serialize::write(inner, p);
465 p.write_field_end();
466 }
467 Value::bool_value(inner) => {
468 p.write_field_begin("bool_value", ::fbthrift::TType::Bool, 2);
469 ::fbthrift::Serialize::write(inner, p);
470 p.write_field_end();
471 }
472 Value::double_value(inner) => {
473 p.write_field_begin("double_value", ::fbthrift::TType::Double, 3);
474 ::fbthrift::Serialize::write(inner, p);
475 p.write_field_end();
476 }
477 Value::string_value(inner) => {
478 p.write_field_begin("string_value", ::fbthrift::TType::String, 4);
479 ::fbthrift::Serialize::write(inner, p);
480 p.write_field_end();
481 }
482 Value::timestamp(inner) => {
483 p.write_field_begin("timestamp", ::fbthrift::TType::I64, 5);
484 ::fbthrift::Serialize::write(inner, p);
485 p.write_field_end();
486 }
487 Value::UnknownField(x) => {
488 p.write_field_begin("UnknownField", ::fbthrift::TType::I32, *x as ::std::primitive::i16);
489 x.write(p);
490 p.write_field_end();
491 }
492 }
493 p.write_field_stop();
494 p.write_struct_end();
495 }
496 }
497
498 impl<P> ::fbthrift::Deserialize<P> for Value
499 where
500 P: ::fbthrift::ProtocolReader,
501 {
502 fn read(p: &mut P) -> ::anyhow::Result<Self> {
503 let _ = p.read_struct_begin(|_| ())?;
504 let mut once = false;
505 let mut alt = ::std::option::Option::None;
506 loop {
507 let (_, fty, fid) = p.read_field_begin(|_| ())?;
508 match (fty, fid as ::std::primitive::i32, once) {
509 (::fbthrift::TType::Stop, _, _) => break,
510 (::fbthrift::TType::I64, 1, false) => {
511 once = true;
512 alt = ::std::option::Option::Some(Value::int_value(::fbthrift::Deserialize::read(p)?));
513 }
514 (::fbthrift::TType::Bool, 2, false) => {
515 once = true;
516 alt = ::std::option::Option::Some(Value::bool_value(::fbthrift::Deserialize::read(p)?));
517 }
518 (::fbthrift::TType::Double, 3, false) => {
519 once = true;
520 alt = ::std::option::Option::Some(Value::double_value(::fbthrift::Deserialize::read(p)?));
521 }
522 (::fbthrift::TType::String, 4, false) => {
523 once = true;
524 alt = ::std::option::Option::Some(Value::string_value(::fbthrift::Deserialize::read(p)?));
525 }
526 (::fbthrift::TType::I64, 5, false) => {
527 once = true;
528 alt = ::std::option::Option::Some(Value::timestamp(::fbthrift::Deserialize::read(p)?));
529 }
530 (fty, _, false) => p.skip(fty)?,
531 (badty, badid, true) => return ::std::result::Result::Err(::std::convert::From::from(::fbthrift::ApplicationException::new(
532 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
533 format!(
534 "unwanted extra union {} field ty {:?} id {}",
535 "Value",
536 badty,
537 badid,
538 ),
539 ))),
540 }
541 p.read_field_end()?;
542 }
543 p.read_struct_end()?;
544 ::std::result::Result::Ok(alt.unwrap_or_default())
545 }
546 }
547
548 impl ::std::default::Default for self::ColumnDef {
549 fn default() -> Self {
550 Self {
551 name: ::std::default::Default::default(),
552 type_: ::std::default::Default::default(),
553 default_value: ::std::option::Option::None,
554 }
555 }
556 }
557
558 unsafe impl ::std::marker::Send for self::ColumnDef {}
559 unsafe impl ::std::marker::Sync for self::ColumnDef {}
560
561 impl ::fbthrift::GetTType for self::ColumnDef {
562 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
563 }
564
565 impl<P> ::fbthrift::Serialize<P> for self::ColumnDef
566 where
567 P: ::fbthrift::ProtocolWriter,
568 {
569 fn write(&self, p: &mut P) {
570 p.write_struct_begin("ColumnDef");
571 p.write_field_begin("name", ::fbthrift::TType::String, 1);
572 ::fbthrift::Serialize::write(&self.name, p);
573 p.write_field_end();
574 p.write_field_begin("type", ::fbthrift::TType::Struct, 2);
575 ::fbthrift::Serialize::write(&self.type_, p);
576 p.write_field_end();
577 if let ::std::option::Option::Some(some) = &self.default_value {
578 p.write_field_begin("default_value", ::fbthrift::TType::Struct, 3);
579 ::fbthrift::Serialize::write(some, p);
580 p.write_field_end();
581 }
582 p.write_field_stop();
583 p.write_struct_end();
584 }
585 }
586
587 impl<P> ::fbthrift::Deserialize<P> for self::ColumnDef
588 where
589 P: ::fbthrift::ProtocolReader,
590 {
591 fn read(p: &mut P) -> ::anyhow::Result<Self> {
592 let mut field_name = ::std::option::Option::None;
593 let mut field_type = ::std::option::Option::None;
594 let mut field_default_value = ::std::option::Option::None;
595 let _ = p.read_struct_begin(|_| ())?;
596 loop {
597 let (_, fty, fid) = p.read_field_begin(|_| ())?;
598 match (fty, fid as ::std::primitive::i32) {
599 (::fbthrift::TType::Stop, _) => break,
600 (::fbthrift::TType::String, 1) => field_name = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
601 (::fbthrift::TType::Struct, 2) => field_type = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
602 (::fbthrift::TType::Struct, 3) => field_default_value = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
603 (fty, _) => p.skip(fty)?,
604 }
605 p.read_field_end()?;
606 }
607 p.read_struct_end()?;
608 ::std::result::Result::Ok(Self {
609 name: field_name.unwrap_or_default(),
610 type_: field_type.unwrap_or_default(),
611 default_value: field_default_value,
612 })
613 }
614 }
615
616
617 impl ::std::default::Default for self::SchemaProp {
618 fn default() -> Self {
619 Self {
620 ttl_duration: ::std::option::Option::None,
621 ttl_col: ::std::option::Option::None,
622 }
623 }
624 }
625
626 unsafe impl ::std::marker::Send for self::SchemaProp {}
627 unsafe impl ::std::marker::Sync for self::SchemaProp {}
628
629 impl ::fbthrift::GetTType for self::SchemaProp {
630 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
631 }
632
633 impl<P> ::fbthrift::Serialize<P> for self::SchemaProp
634 where
635 P: ::fbthrift::ProtocolWriter,
636 {
637 fn write(&self, p: &mut P) {
638 p.write_struct_begin("SchemaProp");
639 if let ::std::option::Option::Some(some) = &self.ttl_duration {
640 p.write_field_begin("ttl_duration", ::fbthrift::TType::I64, 1);
641 ::fbthrift::Serialize::write(some, p);
642 p.write_field_end();
643 }
644 if let ::std::option::Option::Some(some) = &self.ttl_col {
645 p.write_field_begin("ttl_col", ::fbthrift::TType::String, 2);
646 ::fbthrift::Serialize::write(some, p);
647 p.write_field_end();
648 }
649 p.write_field_stop();
650 p.write_struct_end();
651 }
652 }
653
654 impl<P> ::fbthrift::Deserialize<P> for self::SchemaProp
655 where
656 P: ::fbthrift::ProtocolReader,
657 {
658 fn read(p: &mut P) -> ::anyhow::Result<Self> {
659 let mut field_ttl_duration = ::std::option::Option::None;
660 let mut field_ttl_col = ::std::option::Option::None;
661 let _ = p.read_struct_begin(|_| ())?;
662 loop {
663 let (_, fty, fid) = p.read_field_begin(|_| ())?;
664 match (fty, fid as ::std::primitive::i32) {
665 (::fbthrift::TType::Stop, _) => break,
666 (::fbthrift::TType::I64, 1) => field_ttl_duration = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
667 (::fbthrift::TType::String, 2) => field_ttl_col = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
668 (fty, _) => p.skip(fty)?,
669 }
670 p.read_field_end()?;
671 }
672 p.read_struct_end()?;
673 ::std::result::Result::Ok(Self {
674 ttl_duration: field_ttl_duration,
675 ttl_col: field_ttl_col,
676 })
677 }
678 }
679
680
681 impl ::std::default::Default for self::Schema {
682 fn default() -> Self {
683 Self {
684 columns: ::std::default::Default::default(),
685 schema_prop: ::std::default::Default::default(),
686 }
687 }
688 }
689
690 unsafe impl ::std::marker::Send for self::Schema {}
691 unsafe impl ::std::marker::Sync for self::Schema {}
692
693 impl ::fbthrift::GetTType for self::Schema {
694 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
695 }
696
697 impl<P> ::fbthrift::Serialize<P> for self::Schema
698 where
699 P: ::fbthrift::ProtocolWriter,
700 {
701 fn write(&self, p: &mut P) {
702 p.write_struct_begin("Schema");
703 p.write_field_begin("columns", ::fbthrift::TType::List, 1);
704 ::fbthrift::Serialize::write(&self.columns, p);
705 p.write_field_end();
706 p.write_field_begin("schema_prop", ::fbthrift::TType::Struct, 2);
707 ::fbthrift::Serialize::write(&self.schema_prop, p);
708 p.write_field_end();
709 p.write_field_stop();
710 p.write_struct_end();
711 }
712 }
713
714 impl<P> ::fbthrift::Deserialize<P> for self::Schema
715 where
716 P: ::fbthrift::ProtocolReader,
717 {
718 fn read(p: &mut P) -> ::anyhow::Result<Self> {
719 let mut field_columns = ::std::option::Option::None;
720 let mut field_schema_prop = ::std::option::Option::None;
721 let _ = p.read_struct_begin(|_| ())?;
722 loop {
723 let (_, fty, fid) = p.read_field_begin(|_| ())?;
724 match (fty, fid as ::std::primitive::i32) {
725 (::fbthrift::TType::Stop, _) => break,
726 (::fbthrift::TType::List, 1) => field_columns = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
727 (::fbthrift::TType::Struct, 2) => field_schema_prop = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
728 (fty, _) => p.skip(fty)?,
729 }
730 p.read_field_end()?;
731 }
732 p.read_struct_end()?;
733 ::std::result::Result::Ok(Self {
734 columns: field_columns.unwrap_or_default(),
735 schema_prop: field_schema_prop.unwrap_or_default(),
736 })
737 }
738 }
739
740
741
742 impl ::std::default::Default for SchemaID {
743 fn default() -> Self {
744 Self::UnknownField(-1)
745 }
746 }
747
748 impl ::fbthrift::GetTType for SchemaID {
749 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
750 }
751
752 impl<P> ::fbthrift::Serialize<P> for SchemaID
753 where
754 P: ::fbthrift::ProtocolWriter,
755 {
756 fn write(&self, p: &mut P) {
757 p.write_struct_begin("SchemaID");
758 match self {
759 SchemaID::tag_id(inner) => {
760 p.write_field_begin("tag_id", ::fbthrift::TType::I32, 1);
761 ::fbthrift::Serialize::write(inner, p);
762 p.write_field_end();
763 }
764 SchemaID::edge_type(inner) => {
765 p.write_field_begin("edge_type", ::fbthrift::TType::I32, 2);
766 ::fbthrift::Serialize::write(inner, p);
767 p.write_field_end();
768 }
769 SchemaID::UnknownField(x) => {
770 p.write_field_begin("UnknownField", ::fbthrift::TType::I32, *x as ::std::primitive::i16);
771 x.write(p);
772 p.write_field_end();
773 }
774 }
775 p.write_field_stop();
776 p.write_struct_end();
777 }
778 }
779
780 impl<P> ::fbthrift::Deserialize<P> for SchemaID
781 where
782 P: ::fbthrift::ProtocolReader,
783 {
784 fn read(p: &mut P) -> ::anyhow::Result<Self> {
785 let _ = p.read_struct_begin(|_| ())?;
786 let mut once = false;
787 let mut alt = ::std::option::Option::None;
788 loop {
789 let (_, fty, fid) = p.read_field_begin(|_| ())?;
790 match (fty, fid as ::std::primitive::i32, once) {
791 (::fbthrift::TType::Stop, _, _) => break,
792 (::fbthrift::TType::I32, 1, false) => {
793 once = true;
794 alt = ::std::option::Option::Some(SchemaID::tag_id(::fbthrift::Deserialize::read(p)?));
795 }
796 (::fbthrift::TType::I32, 2, false) => {
797 once = true;
798 alt = ::std::option::Option::Some(SchemaID::edge_type(::fbthrift::Deserialize::read(p)?));
799 }
800 (fty, _, false) => p.skip(fty)?,
801 (badty, badid, true) => return ::std::result::Result::Err(::std::convert::From::from(::fbthrift::ApplicationException::new(
802 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
803 format!(
804 "unwanted extra union {} field ty {:?} id {}",
805 "SchemaID",
806 badty,
807 badid,
808 ),
809 ))),
810 }
811 p.read_field_end()?;
812 }
813 p.read_struct_end()?;
814 ::std::result::Result::Ok(alt.unwrap_or_default())
815 }
816 }
817
818 impl ::std::default::Default for self::IndexItem {
819 fn default() -> Self {
820 Self {
821 index_id: ::std::default::Default::default(),
822 index_name: ::std::default::Default::default(),
823 schema_id: ::std::default::Default::default(),
824 schema_name: ::std::default::Default::default(),
825 fields: ::std::default::Default::default(),
826 }
827 }
828 }
829
830 unsafe impl ::std::marker::Send for self::IndexItem {}
831 unsafe impl ::std::marker::Sync for self::IndexItem {}
832
833 impl ::fbthrift::GetTType for self::IndexItem {
834 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
835 }
836
837 impl<P> ::fbthrift::Serialize<P> for self::IndexItem
838 where
839 P: ::fbthrift::ProtocolWriter,
840 {
841 fn write(&self, p: &mut P) {
842 p.write_struct_begin("IndexItem");
843 p.write_field_begin("index_id", ::fbthrift::TType::I32, 1);
844 ::fbthrift::Serialize::write(&self.index_id, p);
845 p.write_field_end();
846 p.write_field_begin("index_name", ::fbthrift::TType::String, 2);
847 ::fbthrift::Serialize::write(&self.index_name, p);
848 p.write_field_end();
849 p.write_field_begin("schema_id", ::fbthrift::TType::Struct, 3);
850 ::fbthrift::Serialize::write(&self.schema_id, p);
851 p.write_field_end();
852 p.write_field_begin("schema_name", ::fbthrift::TType::String, 4);
853 ::fbthrift::Serialize::write(&self.schema_name, p);
854 p.write_field_end();
855 p.write_field_begin("fields", ::fbthrift::TType::List, 5);
856 ::fbthrift::Serialize::write(&self.fields, p);
857 p.write_field_end();
858 p.write_field_stop();
859 p.write_struct_end();
860 }
861 }
862
863 impl<P> ::fbthrift::Deserialize<P> for self::IndexItem
864 where
865 P: ::fbthrift::ProtocolReader,
866 {
867 fn read(p: &mut P) -> ::anyhow::Result<Self> {
868 let mut field_index_id = ::std::option::Option::None;
869 let mut field_index_name = ::std::option::Option::None;
870 let mut field_schema_id = ::std::option::Option::None;
871 let mut field_schema_name = ::std::option::Option::None;
872 let mut field_fields = ::std::option::Option::None;
873 let _ = p.read_struct_begin(|_| ())?;
874 loop {
875 let (_, fty, fid) = p.read_field_begin(|_| ())?;
876 match (fty, fid as ::std::primitive::i32) {
877 (::fbthrift::TType::Stop, _) => break,
878 (::fbthrift::TType::I32, 1) => field_index_id = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
879 (::fbthrift::TType::String, 2) => field_index_name = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
880 (::fbthrift::TType::Struct, 3) => field_schema_id = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
881 (::fbthrift::TType::String, 4) => field_schema_name = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
882 (::fbthrift::TType::List, 5) => field_fields = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
883 (fty, _) => p.skip(fty)?,
884 }
885 p.read_field_end()?;
886 }
887 p.read_struct_end()?;
888 ::std::result::Result::Ok(Self {
889 index_id: field_index_id.unwrap_or_default(),
890 index_name: field_index_name.unwrap_or_default(),
891 schema_id: field_schema_id.unwrap_or_default(),
892 schema_name: field_schema_name.unwrap_or_default(),
893 fields: field_fields.unwrap_or_default(),
894 })
895 }
896 }
897
898
899 impl ::std::default::Default for self::HostAddr {
900 fn default() -> Self {
901 Self {
902 ip: ::std::default::Default::default(),
903 port: ::std::default::Default::default(),
904 }
905 }
906 }
907
908 unsafe impl ::std::marker::Send for self::HostAddr {}
909 unsafe impl ::std::marker::Sync for self::HostAddr {}
910
911 impl ::fbthrift::GetTType for self::HostAddr {
912 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
913 }
914
915 impl<P> ::fbthrift::Serialize<P> for self::HostAddr
916 where
917 P: ::fbthrift::ProtocolWriter,
918 {
919 fn write(&self, p: &mut P) {
920 p.write_struct_begin("HostAddr");
921 p.write_field_begin("ip", ::fbthrift::TType::I32, 1);
922 ::fbthrift::Serialize::write(&self.ip, p);
923 p.write_field_end();
924 p.write_field_begin("port", ::fbthrift::TType::I32, 2);
925 ::fbthrift::Serialize::write(&self.port, p);
926 p.write_field_end();
927 p.write_field_stop();
928 p.write_struct_end();
929 }
930 }
931
932 impl<P> ::fbthrift::Deserialize<P> for self::HostAddr
933 where
934 P: ::fbthrift::ProtocolReader,
935 {
936 fn read(p: &mut P) -> ::anyhow::Result<Self> {
937 let mut field_ip = ::std::option::Option::None;
938 let mut field_port = ::std::option::Option::None;
939 let _ = p.read_struct_begin(|_| ())?;
940 loop {
941 let (_, fty, fid) = p.read_field_begin(|_| ())?;
942 match (fty, fid as ::std::primitive::i32) {
943 (::fbthrift::TType::Stop, _) => break,
944 (::fbthrift::TType::I32, 1) => field_ip = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
945 (::fbthrift::TType::I32, 2) => field_port = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
946 (fty, _) => p.skip(fty)?,
947 }
948 p.read_field_end()?;
949 }
950 p.read_struct_end()?;
951 ::std::result::Result::Ok(Self {
952 ip: field_ip.unwrap_or_default(),
953 port: field_port.unwrap_or_default(),
954 })
955 }
956 }
957
958
959 impl ::std::default::Default for self::Pair {
960 fn default() -> Self {
961 Self {
962 key: ::std::default::Default::default(),
963 value: ::std::default::Default::default(),
964 }
965 }
966 }
967
968 unsafe impl ::std::marker::Send for self::Pair {}
969 unsafe impl ::std::marker::Sync for self::Pair {}
970
971 impl ::fbthrift::GetTType for self::Pair {
972 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
973 }
974
975 impl<P> ::fbthrift::Serialize<P> for self::Pair
976 where
977 P: ::fbthrift::ProtocolWriter,
978 {
979 fn write(&self, p: &mut P) {
980 p.write_struct_begin("Pair");
981 p.write_field_begin("key", ::fbthrift::TType::String, 1);
982 ::fbthrift::Serialize::write(&self.key, p);
983 p.write_field_end();
984 p.write_field_begin("value", ::fbthrift::TType::String, 2);
985 ::fbthrift::Serialize::write(&self.value, p);
986 p.write_field_end();
987 p.write_field_stop();
988 p.write_struct_end();
989 }
990 }
991
992 impl<P> ::fbthrift::Deserialize<P> for self::Pair
993 where
994 P: ::fbthrift::ProtocolReader,
995 {
996 fn read(p: &mut P) -> ::anyhow::Result<Self> {
997 let mut field_key = ::std::option::Option::None;
998 let mut field_value = ::std::option::Option::None;
999 let _ = p.read_struct_begin(|_| ())?;
1000 loop {
1001 let (_, fty, fid) = p.read_field_begin(|_| ())?;
1002 match (fty, fid as ::std::primitive::i32) {
1003 (::fbthrift::TType::Stop, _) => break,
1004 (::fbthrift::TType::String, 1) => field_key = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
1005 (::fbthrift::TType::String, 2) => field_value = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
1006 (fty, _) => p.skip(fty)?,
1007 }
1008 p.read_field_end()?;
1009 }
1010 p.read_struct_end()?;
1011 ::std::result::Result::Ok(Self {
1012 key: field_key.unwrap_or_default(),
1013 value: field_value.unwrap_or_default(),
1014 })
1015 }
1016 }
1017
1018
1019 impl ::std::default::Default for self::RoleItem {
1020 fn default() -> Self {
1021 Self {
1022 user: ::std::default::Default::default(),
1023 space_id: ::std::default::Default::default(),
1024 role_type: ::std::default::Default::default(),
1025 }
1026 }
1027 }
1028
1029 unsafe impl ::std::marker::Send for self::RoleItem {}
1030 unsafe impl ::std::marker::Sync for self::RoleItem {}
1031
1032 impl ::fbthrift::GetTType for self::RoleItem {
1033 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
1034 }
1035
1036 impl<P> ::fbthrift::Serialize<P> for self::RoleItem
1037 where
1038 P: ::fbthrift::ProtocolWriter,
1039 {
1040 fn write(&self, p: &mut P) {
1041 p.write_struct_begin("RoleItem");
1042 p.write_field_begin("user", ::fbthrift::TType::String, 1);
1043 ::fbthrift::Serialize::write(&self.user, p);
1044 p.write_field_end();
1045 p.write_field_begin("space_id", ::fbthrift::TType::I32, 2);
1046 ::fbthrift::Serialize::write(&self.space_id, p);
1047 p.write_field_end();
1048 p.write_field_begin("role_type", ::fbthrift::TType::I32, 3);
1049 ::fbthrift::Serialize::write(&self.role_type, p);
1050 p.write_field_end();
1051 p.write_field_stop();
1052 p.write_struct_end();
1053 }
1054 }
1055
1056 impl<P> ::fbthrift::Deserialize<P> for self::RoleItem
1057 where
1058 P: ::fbthrift::ProtocolReader,
1059 {
1060 fn read(p: &mut P) -> ::anyhow::Result<Self> {
1061 let mut field_user = ::std::option::Option::None;
1062 let mut field_space_id = ::std::option::Option::None;
1063 let mut field_role_type = ::std::option::Option::None;
1064 let _ = p.read_struct_begin(|_| ())?;
1065 loop {
1066 let (_, fty, fid) = p.read_field_begin(|_| ())?;
1067 match (fty, fid as ::std::primitive::i32) {
1068 (::fbthrift::TType::Stop, _) => break,
1069 (::fbthrift::TType::String, 1) => field_user = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
1070 (::fbthrift::TType::I32, 2) => field_space_id = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
1071 (::fbthrift::TType::I32, 3) => field_role_type = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
1072 (fty, _) => p.skip(fty)?,
1073 }
1074 p.read_field_end()?;
1075 }
1076 p.read_struct_end()?;
1077 ::std::result::Result::Ok(Self {
1078 user: field_user.unwrap_or_default(),
1079 space_id: field_space_id.unwrap_or_default(),
1080 role_type: field_role_type.unwrap_or_default(),
1081 })
1082 }
1083 }
1084
1085}
1086
1087pub mod errors {
1088}