nebula_fbthrift_common_v1/
types.rs

1// @generated by Thrift for src/interface/common.thrift
2// This file is probably not the place you want to edit!
3
4//! Thrift type definitions for `common`.
5
6#![allow(clippy::redundant_closure)]
7
8
9pub type GraphSpaceID = ::std::primitive::i32;
10
11pub type PartitionID = ::std::primitive::i32;
12
13pub type TagID = ::std::primitive::i32;
14
15pub type EdgeType = ::std::primitive::i32;
16
17pub type EdgeRanking = ::std::primitive::i64;
18
19pub type VertexID = ::std::primitive::i64;
20
21pub type IndexID = ::std::primitive::i32;
22
23pub type IPv4 = ::std::primitive::i32;
24
25pub type Port = ::std::primitive::i32;
26
27pub type SchemaVer = ::std::primitive::i64;
28
29pub type ClusterID = ::std::primitive::i64;
30
31#[derive(Clone, PartialEq)]
32pub struct ValueType {
33    pub r#type: crate::types::SupportedType,
34    pub value_type: ::std::option::Option<Box<crate::types::ValueType>>,
35    pub schema: ::std::option::Option<crate::types::Schema>,
36    // This field forces `..Default::default()` when instantiating this
37    // struct, to make code future-proof against new fields added later to
38    // the definition in Thrift. If you don't want this, add the annotation
39    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
40    #[doc(hidden)]
41    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
42}
43
44#[derive(Clone, PartialEq, Debug)]
45pub enum Value {
46    int_value(::std::primitive::i64),
47    bool_value(::std::primitive::bool),
48    double_value(::std::primitive::f64),
49    string_value(::std::string::String),
50    timestamp(::std::primitive::i64),
51    UnknownField(::std::primitive::i32),
52}
53
54#[derive(Clone, PartialEq)]
55pub struct ColumnDef {
56    pub name: ::std::string::String,
57    pub r#type: crate::types::ValueType,
58    pub default_value: ::std::option::Option<crate::types::Value>,
59    // This field forces `..Default::default()` when instantiating this
60    // struct, to make code future-proof against new fields added later to
61    // the definition in Thrift. If you don't want this, add the annotation
62    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
63    #[doc(hidden)]
64    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
65}
66
67#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
68pub struct SchemaProp {
69    pub ttl_duration: ::std::option::Option<::std::primitive::i64>,
70    pub ttl_col: ::std::option::Option<::std::string::String>,
71    // This field forces `..Default::default()` when instantiating this
72    // struct, to make code future-proof against new fields added later to
73    // the definition in Thrift. If you don't want this, add the annotation
74    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
75    #[doc(hidden)]
76    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
77}
78
79#[derive(Clone, PartialEq)]
80pub struct Schema {
81    pub columns: ::std::vec::Vec<crate::types::ColumnDef>,
82    pub schema_prop: crate::types::SchemaProp,
83    // This field forces `..Default::default()` when instantiating this
84    // struct, to make code future-proof against new fields added later to
85    // the definition in Thrift. If you don't want this, add the annotation
86    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
87    #[doc(hidden)]
88    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
89}
90
91#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
92pub enum SchemaID {
93    tag_id(crate::types::TagID),
94    edge_type(crate::types::EdgeType),
95    UnknownField(::std::primitive::i32),
96}
97
98#[derive(Clone, PartialEq)]
99pub struct IndexItem {
100    pub index_id: crate::types::IndexID,
101    pub index_name: ::std::string::String,
102    pub schema_id: crate::types::SchemaID,
103    pub schema_name: ::std::string::String,
104    pub fields: ::std::vec::Vec<crate::types::ColumnDef>,
105    // This field forces `..Default::default()` when instantiating this
106    // struct, to make code future-proof against new fields added later to
107    // the definition in Thrift. If you don't want this, add the annotation
108    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
109    #[doc(hidden)]
110    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
111}
112
113#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
114pub struct HostAddr {
115    pub ip: crate::types::IPv4,
116    pub port: crate::types::Port,
117    // This field forces `..Default::default()` when instantiating this
118    // struct, to make code future-proof against new fields added later to
119    // the definition in Thrift. If you don't want this, add the annotation
120    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
121    #[doc(hidden)]
122    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
123}
124
125#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
126pub struct Pair {
127    pub key: ::std::string::String,
128    pub value: ::std::string::String,
129    // This field forces `..Default::default()` when instantiating this
130    // struct, to make code future-proof against new fields added later to
131    // the definition in Thrift. If you don't want this, add the annotation
132    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
133    #[doc(hidden)]
134    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
135}
136
137#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
138pub struct RoleItem {
139    pub user: ::std::string::String,
140    pub space_id: crate::types::GraphSpaceID,
141    pub role_type: crate::types::RoleType,
142    // This field forces `..Default::default()` when instantiating this
143    // struct, to make code future-proof against new fields added later to
144    // the definition in Thrift. If you don't want this, add the annotation
145    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
146    #[doc(hidden)]
147    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
148}
149
150#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
151pub struct SupportedType(pub ::std::primitive::i32);
152
153impl SupportedType {
154    pub const UNKNOWN: Self = SupportedType(0i32);
155    pub const BOOL: Self = SupportedType(1i32);
156    pub const INT: Self = SupportedType(2i32);
157    pub const VID: Self = SupportedType(3i32);
158    pub const FLOAT: Self = SupportedType(4i32);
159    pub const DOUBLE: Self = SupportedType(5i32);
160    pub const STRING: Self = SupportedType(6i32);
161    pub const TIMESTAMP: Self = SupportedType(21i32);
162    pub const YEAR: Self = SupportedType(22i32);
163    pub const YEARMONTH: Self = SupportedType(23i32);
164    pub const DATE: Self = SupportedType(24i32);
165    pub const DATETIME: Self = SupportedType(25i32);
166    pub const PATH: Self = SupportedType(41i32);
167}
168
169impl ::fbthrift::ThriftEnum for SupportedType {
170    fn enumerate() -> &'static [(Self, &'static str)] {
171        &[
172            (Self::UNKNOWN, "UNKNOWN"),
173            (Self::BOOL, "BOOL"),
174            (Self::INT, "INT"),
175            (Self::VID, "VID"),
176            (Self::FLOAT, "FLOAT"),
177            (Self::DOUBLE, "DOUBLE"),
178            (Self::STRING, "STRING"),
179            (Self::TIMESTAMP, "TIMESTAMP"),
180            (Self::YEAR, "YEAR"),
181            (Self::YEARMONTH, "YEARMONTH"),
182            (Self::DATE, "DATE"),
183            (Self::DATETIME, "DATETIME"),
184            (Self::PATH, "PATH"),
185        ]
186    }
187
188    fn variants() -> &'static [&'static str] {
189        &[
190            "UNKNOWN",
191            "BOOL",
192            "INT",
193            "VID",
194            "FLOAT",
195            "DOUBLE",
196            "STRING",
197            "TIMESTAMP",
198            "YEAR",
199            "YEARMONTH",
200            "DATE",
201            "DATETIME",
202            "PATH",
203        ]
204    }
205
206    fn variant_values() -> &'static [Self] {
207        &[
208            Self::UNKNOWN,
209            Self::BOOL,
210            Self::INT,
211            Self::VID,
212            Self::FLOAT,
213            Self::DOUBLE,
214            Self::STRING,
215            Self::TIMESTAMP,
216            Self::YEAR,
217            Self::YEARMONTH,
218            Self::DATE,
219            Self::DATETIME,
220            Self::PATH,
221        ]
222    }
223}
224
225impl ::std::default::Default for SupportedType {
226    fn default() -> Self {
227        Self(::fbthrift::__UNKNOWN_ID)
228    }
229}
230
231impl<'a> ::std::convert::From<&'a SupportedType> for ::std::primitive::i32 {
232    #[inline]
233    fn from(x: &'a SupportedType) -> Self {
234        x.0
235    }
236}
237
238impl ::std::convert::From<SupportedType> for ::std::primitive::i32 {
239    #[inline]
240    fn from(x: SupportedType) -> Self {
241        x.0
242    }
243}
244
245impl ::std::convert::From<::std::primitive::i32> for SupportedType {
246    #[inline]
247    fn from(x: ::std::primitive::i32) -> Self {
248        Self(x)
249    }
250}
251
252impl ::std::fmt::Display for SupportedType {
253    fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
254        static VARIANTS_BY_NUMBER: &[(&::std::primitive::str, ::std::primitive::i32)] = &[
255            ("UNKNOWN", 0),
256            ("BOOL", 1),
257            ("INT", 2),
258            ("VID", 3),
259            ("FLOAT", 4),
260            ("DOUBLE", 5),
261            ("STRING", 6),
262            ("TIMESTAMP", 21),
263            ("YEAR", 22),
264            ("YEARMONTH", 23),
265            ("DATE", 24),
266            ("DATETIME", 25),
267            ("PATH", 41),
268        ];
269        ::fbthrift::help::enum_display(VARIANTS_BY_NUMBER, fmt, self.0)
270    }
271}
272
273impl ::std::fmt::Debug for SupportedType {
274    fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
275        write!(fmt, "SupportedType::{}", self)
276    }
277}
278
279impl ::std::str::FromStr for SupportedType {
280    type Err = ::anyhow::Error;
281
282    fn from_str(string: &::std::primitive::str) -> ::std::result::Result<Self, Self::Err> {
283        static VARIANTS_BY_NAME: &[(&::std::primitive::str, ::std::primitive::i32)] = &[
284            ("BOOL", 1),
285            ("DATE", 24),
286            ("DATETIME", 25),
287            ("DOUBLE", 5),
288            ("FLOAT", 4),
289            ("INT", 2),
290            ("PATH", 41),
291            ("STRING", 6),
292            ("TIMESTAMP", 21),
293            ("UNKNOWN", 0),
294            ("VID", 3),
295            ("YEAR", 22),
296            ("YEARMONTH", 23),
297        ];
298        ::fbthrift::help::enum_from_str(VARIANTS_BY_NAME, string, "SupportedType").map(Self)
299    }
300}
301
302impl ::fbthrift::GetTType for SupportedType {
303    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::I32;
304}
305
306impl<P> ::fbthrift::Serialize<P> for SupportedType
307where
308    P: ::fbthrift::ProtocolWriter,
309{
310    #[inline]
311    fn write(&self, p: &mut P) {
312        p.write_i32(self.into())
313    }
314}
315
316impl<P> ::fbthrift::Deserialize<P> for SupportedType
317where
318    P: ::fbthrift::ProtocolReader,
319{
320    #[inline]
321    fn read(p: &mut P) -> ::anyhow::Result<Self> {
322        ::std::result::Result::Ok(Self::from(p.read_i32()?))
323    }
324}
325
326#[doc = "* GOD is A global senior administrator.like root of Linux systems.\n* ADMIN is an administrator for a given Graph Space.\n* DBA is an schema administrator for a given Graph Space.\n* USER is a normal user for a given Graph Space. A User can access (read and write) the data in the Graph Space.\n* GUEST is a read-only role for a given Graph Space. A Guest cannot modify the data in the Graph Space.\n* Refer to header file src/graph/PermissionManager.h for details."]
327#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
328pub struct RoleType(pub ::std::primitive::i32);
329
330impl RoleType {
331    pub const GOD: Self = RoleType(1i32);
332    pub const ADMIN: Self = RoleType(2i32);
333    pub const DBA: Self = RoleType(3i32);
334    pub const USER: Self = RoleType(4i32);
335    pub const GUEST: Self = RoleType(5i32);
336}
337
338impl ::fbthrift::ThriftEnum for RoleType {
339    fn enumerate() -> &'static [(Self, &'static str)] {
340        &[
341            (Self::GOD, "GOD"),
342            (Self::ADMIN, "ADMIN"),
343            (Self::DBA, "DBA"),
344            (Self::USER, "USER"),
345            (Self::GUEST, "GUEST"),
346        ]
347    }
348
349    fn variants() -> &'static [&'static str] {
350        &[
351            "GOD",
352            "ADMIN",
353            "DBA",
354            "USER",
355            "GUEST",
356        ]
357    }
358
359    fn variant_values() -> &'static [Self] {
360        &[
361            Self::GOD,
362            Self::ADMIN,
363            Self::DBA,
364            Self::USER,
365            Self::GUEST,
366        ]
367    }
368}
369
370impl ::std::default::Default for RoleType {
371    fn default() -> Self {
372        Self(::fbthrift::__UNKNOWN_ID)
373    }
374}
375
376impl<'a> ::std::convert::From<&'a RoleType> for ::std::primitive::i32 {
377    #[inline]
378    fn from(x: &'a RoleType) -> Self {
379        x.0
380    }
381}
382
383impl ::std::convert::From<RoleType> for ::std::primitive::i32 {
384    #[inline]
385    fn from(x: RoleType) -> Self {
386        x.0
387    }
388}
389
390impl ::std::convert::From<::std::primitive::i32> for RoleType {
391    #[inline]
392    fn from(x: ::std::primitive::i32) -> Self {
393        Self(x)
394    }
395}
396
397impl ::std::fmt::Display for RoleType {
398    fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
399        static VARIANTS_BY_NUMBER: &[(&::std::primitive::str, ::std::primitive::i32)] = &[
400            ("GOD", 1),
401            ("ADMIN", 2),
402            ("DBA", 3),
403            ("USER", 4),
404            ("GUEST", 5),
405        ];
406        ::fbthrift::help::enum_display(VARIANTS_BY_NUMBER, fmt, self.0)
407    }
408}
409
410impl ::std::fmt::Debug for RoleType {
411    fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
412        write!(fmt, "RoleType::{}", self)
413    }
414}
415
416impl ::std::str::FromStr for RoleType {
417    type Err = ::anyhow::Error;
418
419    fn from_str(string: &::std::primitive::str) -> ::std::result::Result<Self, Self::Err> {
420        static VARIANTS_BY_NAME: &[(&::std::primitive::str, ::std::primitive::i32)] = &[
421            ("ADMIN", 2),
422            ("DBA", 3),
423            ("GOD", 1),
424            ("GUEST", 5),
425            ("USER", 4),
426        ];
427        ::fbthrift::help::enum_from_str(VARIANTS_BY_NAME, string, "RoleType").map(Self)
428    }
429}
430
431impl ::fbthrift::GetTType for RoleType {
432    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::I32;
433}
434
435impl<P> ::fbthrift::Serialize<P> for RoleType
436where
437    P: ::fbthrift::ProtocolWriter,
438{
439    #[inline]
440    fn write(&self, p: &mut P) {
441        p.write_i32(self.into())
442    }
443}
444
445impl<P> ::fbthrift::Deserialize<P> for RoleType
446where
447    P: ::fbthrift::ProtocolReader,
448{
449    #[inline]
450    fn read(p: &mut P) -> ::anyhow::Result<Self> {
451        ::std::result::Result::Ok(Self::from(p.read_i32()?))
452    }
453}
454
455
456
457
458
459
460
461
462
463
464
465
466#[allow(clippy::derivable_impls)]
467impl ::std::default::Default for self::ValueType {
468    fn default() -> Self {
469        Self {
470            r#type: ::std::default::Default::default(),
471            value_type: ::std::option::Option::None,
472            schema: ::std::option::Option::None,
473            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
474        }
475    }
476}
477
478impl ::std::fmt::Debug for self::ValueType {
479    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
480        formatter
481            .debug_struct("ValueType")
482            .field("r#type", &self.r#type)
483            .field("value_type", &self.value_type)
484            .field("schema", &self.schema)
485            .finish()
486    }
487}
488
489unsafe impl ::std::marker::Send for self::ValueType {}
490unsafe impl ::std::marker::Sync for self::ValueType {}
491
492impl ::fbthrift::GetTType for self::ValueType {
493    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
494}
495
496impl<P> ::fbthrift::Serialize<P> for self::ValueType
497where
498    P: ::fbthrift::ProtocolWriter,
499{
500    fn write(&self, p: &mut P) {
501        p.write_struct_begin("ValueType");
502        p.write_field_begin("type", ::fbthrift::TType::I32, 1);
503        ::fbthrift::Serialize::write(&self.r#type, p);
504        p.write_field_end();
505        if let ::std::option::Option::Some(some) = &self.value_type {
506            p.write_field_begin("value_type", ::fbthrift::TType::Struct, 2);
507            ::fbthrift::Serialize::write(some, p);
508            p.write_field_end();
509        }
510        if let ::std::option::Option::Some(some) = &self.schema {
511            p.write_field_begin("schema", ::fbthrift::TType::Struct, 3);
512            ::fbthrift::Serialize::write(some, p);
513            p.write_field_end();
514        }
515        p.write_field_stop();
516        p.write_struct_end();
517    }
518}
519
520impl<P> ::fbthrift::Deserialize<P> for self::ValueType
521where
522    P: ::fbthrift::ProtocolReader,
523{
524    fn read(p: &mut P) -> ::anyhow::Result<Self> {
525        static FIELDS: &[::fbthrift::Field] = &[
526            ::fbthrift::Field::new("schema", ::fbthrift::TType::Struct, 3),
527            ::fbthrift::Field::new("type", ::fbthrift::TType::I32, 1),
528            ::fbthrift::Field::new("value_type", ::fbthrift::TType::Struct, 2),
529        ];
530        let mut field_type = ::std::option::Option::None;
531        let mut field_value_type = ::std::option::Option::None;
532        let mut field_schema = ::std::option::Option::None;
533        let _ = p.read_struct_begin(|_| ())?;
534        loop {
535            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
536            match (fty, fid as ::std::primitive::i32) {
537                (::fbthrift::TType::Stop, _) => break,
538                (::fbthrift::TType::I32, 1) => field_type = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
539                (::fbthrift::TType::Struct, 2) => field_value_type = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
540                (::fbthrift::TType::Struct, 3) => field_schema = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
541                (fty, _) => p.skip(fty)?,
542            }
543            p.read_field_end()?;
544        }
545        p.read_struct_end()?;
546        ::std::result::Result::Ok(Self {
547            r#type: field_type.unwrap_or_default(),
548            value_type: field_value_type,
549            schema: field_schema,
550            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
551        })
552    }
553}
554
555
556
557impl ::std::default::Default for Value {
558    fn default() -> Self {
559        Self::UnknownField(-1)
560    }
561}
562
563impl ::fbthrift::GetTType for Value {
564    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
565}
566
567impl<P> ::fbthrift::Serialize<P> for Value
568where
569    P: ::fbthrift::ProtocolWriter,
570{
571    fn write(&self, p: &mut P) {
572        p.write_struct_begin("Value");
573        match self {
574            Self::int_value(inner) => {
575                p.write_field_begin("int_value", ::fbthrift::TType::I64, 1);
576                ::fbthrift::Serialize::write(inner, p);
577                p.write_field_end();
578            }
579            Self::bool_value(inner) => {
580                p.write_field_begin("bool_value", ::fbthrift::TType::Bool, 2);
581                ::fbthrift::Serialize::write(inner, p);
582                p.write_field_end();
583            }
584            Self::double_value(inner) => {
585                p.write_field_begin("double_value", ::fbthrift::TType::Double, 3);
586                ::fbthrift::Serialize::write(inner, p);
587                p.write_field_end();
588            }
589            Self::string_value(inner) => {
590                p.write_field_begin("string_value", ::fbthrift::TType::String, 4);
591                ::fbthrift::Serialize::write(inner, p);
592                p.write_field_end();
593            }
594            Self::timestamp(inner) => {
595                p.write_field_begin("timestamp", ::fbthrift::TType::I64, 5);
596                ::fbthrift::Serialize::write(inner, p);
597                p.write_field_end();
598            }
599            Self::UnknownField(_) => {}
600        }
601        p.write_field_stop();
602        p.write_struct_end();
603    }
604}
605
606impl<P> ::fbthrift::Deserialize<P> for Value
607where
608    P: ::fbthrift::ProtocolReader,
609{
610    fn read(p: &mut P) -> ::anyhow::Result<Self> {
611        static FIELDS: &[::fbthrift::Field] = &[
612            ::fbthrift::Field::new("bool_value", ::fbthrift::TType::Bool, 2),
613            ::fbthrift::Field::new("double_value", ::fbthrift::TType::Double, 3),
614            ::fbthrift::Field::new("int_value", ::fbthrift::TType::I64, 1),
615            ::fbthrift::Field::new("string_value", ::fbthrift::TType::String, 4),
616            ::fbthrift::Field::new("timestamp", ::fbthrift::TType::I64, 5),
617        ];
618        let _ = p.read_struct_begin(|_| ())?;
619        let mut once = false;
620        let mut alt = ::std::option::Option::None;
621        loop {
622            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
623            match (fty, fid as ::std::primitive::i32, once) {
624                (::fbthrift::TType::Stop, _, _) => break,
625                (::fbthrift::TType::I64, 1, false) => {
626                    once = true;
627                    alt = ::std::option::Option::Some(Self::int_value(::fbthrift::Deserialize::read(p)?));
628                }
629                (::fbthrift::TType::Bool, 2, false) => {
630                    once = true;
631                    alt = ::std::option::Option::Some(Self::bool_value(::fbthrift::Deserialize::read(p)?));
632                }
633                (::fbthrift::TType::Double, 3, false) => {
634                    once = true;
635                    alt = ::std::option::Option::Some(Self::double_value(::fbthrift::Deserialize::read(p)?));
636                }
637                (::fbthrift::TType::String, 4, false) => {
638                    once = true;
639                    alt = ::std::option::Option::Some(Self::string_value(::fbthrift::Deserialize::read(p)?));
640                }
641                (::fbthrift::TType::I64, 5, false) => {
642                    once = true;
643                    alt = ::std::option::Option::Some(Self::timestamp(::fbthrift::Deserialize::read(p)?));
644                }
645                (fty, _, false) => p.skip(fty)?,
646                (badty, badid, true) => return ::std::result::Result::Err(::std::convert::From::from(::fbthrift::ApplicationException::new(
647                    ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
648                    format!(
649                        "unwanted extra union {} field ty {:?} id {}",
650                        "Value",
651                        badty,
652                        badid,
653                    ),
654                ))),
655            }
656            p.read_field_end()?;
657        }
658        p.read_struct_end()?;
659        ::std::result::Result::Ok(alt.unwrap_or_default())
660    }
661}
662
663#[allow(clippy::derivable_impls)]
664impl ::std::default::Default for self::ColumnDef {
665    fn default() -> Self {
666        Self {
667            name: ::std::default::Default::default(),
668            r#type: ::std::default::Default::default(),
669            default_value: ::std::option::Option::None,
670            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
671        }
672    }
673}
674
675impl ::std::fmt::Debug for self::ColumnDef {
676    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
677        formatter
678            .debug_struct("ColumnDef")
679            .field("name", &self.name)
680            .field("r#type", &self.r#type)
681            .field("default_value", &self.default_value)
682            .finish()
683    }
684}
685
686unsafe impl ::std::marker::Send for self::ColumnDef {}
687unsafe impl ::std::marker::Sync for self::ColumnDef {}
688
689impl ::fbthrift::GetTType for self::ColumnDef {
690    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
691}
692
693impl<P> ::fbthrift::Serialize<P> for self::ColumnDef
694where
695    P: ::fbthrift::ProtocolWriter,
696{
697    fn write(&self, p: &mut P) {
698        p.write_struct_begin("ColumnDef");
699        p.write_field_begin("name", ::fbthrift::TType::String, 1);
700        ::fbthrift::Serialize::write(&self.name, p);
701        p.write_field_end();
702        p.write_field_begin("type", ::fbthrift::TType::Struct, 2);
703        ::fbthrift::Serialize::write(&self.r#type, p);
704        p.write_field_end();
705        if let ::std::option::Option::Some(some) = &self.default_value {
706            p.write_field_begin("default_value", ::fbthrift::TType::Struct, 3);
707            ::fbthrift::Serialize::write(some, p);
708            p.write_field_end();
709        }
710        p.write_field_stop();
711        p.write_struct_end();
712    }
713}
714
715impl<P> ::fbthrift::Deserialize<P> for self::ColumnDef
716where
717    P: ::fbthrift::ProtocolReader,
718{
719    fn read(p: &mut P) -> ::anyhow::Result<Self> {
720        static FIELDS: &[::fbthrift::Field] = &[
721            ::fbthrift::Field::new("default_value", ::fbthrift::TType::Struct, 3),
722            ::fbthrift::Field::new("name", ::fbthrift::TType::String, 1),
723            ::fbthrift::Field::new("type", ::fbthrift::TType::Struct, 2),
724        ];
725        let mut field_name = ::std::option::Option::None;
726        let mut field_type = ::std::option::Option::None;
727        let mut field_default_value = ::std::option::Option::None;
728        let _ = p.read_struct_begin(|_| ())?;
729        loop {
730            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
731            match (fty, fid as ::std::primitive::i32) {
732                (::fbthrift::TType::Stop, _) => break,
733                (::fbthrift::TType::String, 1) => field_name = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
734                (::fbthrift::TType::Struct, 2) => field_type = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
735                (::fbthrift::TType::Struct, 3) => field_default_value = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
736                (fty, _) => p.skip(fty)?,
737            }
738            p.read_field_end()?;
739        }
740        p.read_struct_end()?;
741        ::std::result::Result::Ok(Self {
742            name: field_name.unwrap_or_default(),
743            r#type: field_type.unwrap_or_default(),
744            default_value: field_default_value,
745            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
746        })
747    }
748}
749
750
751#[allow(clippy::derivable_impls)]
752impl ::std::default::Default for self::SchemaProp {
753    fn default() -> Self {
754        Self {
755            ttl_duration: ::std::option::Option::None,
756            ttl_col: ::std::option::Option::None,
757            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
758        }
759    }
760}
761
762impl ::std::fmt::Debug for self::SchemaProp {
763    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
764        formatter
765            .debug_struct("SchemaProp")
766            .field("ttl_duration", &self.ttl_duration)
767            .field("ttl_col", &self.ttl_col)
768            .finish()
769    }
770}
771
772unsafe impl ::std::marker::Send for self::SchemaProp {}
773unsafe impl ::std::marker::Sync for self::SchemaProp {}
774
775impl ::fbthrift::GetTType for self::SchemaProp {
776    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
777}
778
779impl<P> ::fbthrift::Serialize<P> for self::SchemaProp
780where
781    P: ::fbthrift::ProtocolWriter,
782{
783    fn write(&self, p: &mut P) {
784        p.write_struct_begin("SchemaProp");
785        if let ::std::option::Option::Some(some) = &self.ttl_duration {
786            p.write_field_begin("ttl_duration", ::fbthrift::TType::I64, 1);
787            ::fbthrift::Serialize::write(some, p);
788            p.write_field_end();
789        }
790        if let ::std::option::Option::Some(some) = &self.ttl_col {
791            p.write_field_begin("ttl_col", ::fbthrift::TType::String, 2);
792            ::fbthrift::Serialize::write(some, p);
793            p.write_field_end();
794        }
795        p.write_field_stop();
796        p.write_struct_end();
797    }
798}
799
800impl<P> ::fbthrift::Deserialize<P> for self::SchemaProp
801where
802    P: ::fbthrift::ProtocolReader,
803{
804    fn read(p: &mut P) -> ::anyhow::Result<Self> {
805        static FIELDS: &[::fbthrift::Field] = &[
806            ::fbthrift::Field::new("ttl_col", ::fbthrift::TType::String, 2),
807            ::fbthrift::Field::new("ttl_duration", ::fbthrift::TType::I64, 1),
808        ];
809        let mut field_ttl_duration = ::std::option::Option::None;
810        let mut field_ttl_col = ::std::option::Option::None;
811        let _ = p.read_struct_begin(|_| ())?;
812        loop {
813            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
814            match (fty, fid as ::std::primitive::i32) {
815                (::fbthrift::TType::Stop, _) => break,
816                (::fbthrift::TType::I64, 1) => field_ttl_duration = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
817                (::fbthrift::TType::String, 2) => field_ttl_col = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
818                (fty, _) => p.skip(fty)?,
819            }
820            p.read_field_end()?;
821        }
822        p.read_struct_end()?;
823        ::std::result::Result::Ok(Self {
824            ttl_duration: field_ttl_duration,
825            ttl_col: field_ttl_col,
826            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
827        })
828    }
829}
830
831
832#[allow(clippy::derivable_impls)]
833impl ::std::default::Default for self::Schema {
834    fn default() -> Self {
835        Self {
836            columns: ::std::default::Default::default(),
837            schema_prop: ::std::default::Default::default(),
838            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
839        }
840    }
841}
842
843impl ::std::fmt::Debug for self::Schema {
844    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
845        formatter
846            .debug_struct("Schema")
847            .field("columns", &self.columns)
848            .field("schema_prop", &self.schema_prop)
849            .finish()
850    }
851}
852
853unsafe impl ::std::marker::Send for self::Schema {}
854unsafe impl ::std::marker::Sync for self::Schema {}
855
856impl ::fbthrift::GetTType for self::Schema {
857    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
858}
859
860impl<P> ::fbthrift::Serialize<P> for self::Schema
861where
862    P: ::fbthrift::ProtocolWriter,
863{
864    fn write(&self, p: &mut P) {
865        p.write_struct_begin("Schema");
866        p.write_field_begin("columns", ::fbthrift::TType::List, 1);
867        ::fbthrift::Serialize::write(&self.columns, p);
868        p.write_field_end();
869        p.write_field_begin("schema_prop", ::fbthrift::TType::Struct, 2);
870        ::fbthrift::Serialize::write(&self.schema_prop, p);
871        p.write_field_end();
872        p.write_field_stop();
873        p.write_struct_end();
874    }
875}
876
877impl<P> ::fbthrift::Deserialize<P> for self::Schema
878where
879    P: ::fbthrift::ProtocolReader,
880{
881    fn read(p: &mut P) -> ::anyhow::Result<Self> {
882        static FIELDS: &[::fbthrift::Field] = &[
883            ::fbthrift::Field::new("columns", ::fbthrift::TType::List, 1),
884            ::fbthrift::Field::new("schema_prop", ::fbthrift::TType::Struct, 2),
885        ];
886        let mut field_columns = ::std::option::Option::None;
887        let mut field_schema_prop = ::std::option::Option::None;
888        let _ = p.read_struct_begin(|_| ())?;
889        loop {
890            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
891            match (fty, fid as ::std::primitive::i32) {
892                (::fbthrift::TType::Stop, _) => break,
893                (::fbthrift::TType::List, 1) => field_columns = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
894                (::fbthrift::TType::Struct, 2) => field_schema_prop = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
895                (fty, _) => p.skip(fty)?,
896            }
897            p.read_field_end()?;
898        }
899        p.read_struct_end()?;
900        ::std::result::Result::Ok(Self {
901            columns: field_columns.unwrap_or_default(),
902            schema_prop: field_schema_prop.unwrap_or_default(),
903            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
904        })
905    }
906}
907
908
909
910impl ::std::default::Default for SchemaID {
911    fn default() -> Self {
912        Self::UnknownField(-1)
913    }
914}
915
916impl ::fbthrift::GetTType for SchemaID {
917    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
918}
919
920impl<P> ::fbthrift::Serialize<P> for SchemaID
921where
922    P: ::fbthrift::ProtocolWriter,
923{
924    fn write(&self, p: &mut P) {
925        p.write_struct_begin("SchemaID");
926        match self {
927            Self::tag_id(inner) => {
928                p.write_field_begin("tag_id", ::fbthrift::TType::I32, 1);
929                ::fbthrift::Serialize::write(inner, p);
930                p.write_field_end();
931            }
932            Self::edge_type(inner) => {
933                p.write_field_begin("edge_type", ::fbthrift::TType::I32, 2);
934                ::fbthrift::Serialize::write(inner, p);
935                p.write_field_end();
936            }
937            Self::UnknownField(_) => {}
938        }
939        p.write_field_stop();
940        p.write_struct_end();
941    }
942}
943
944impl<P> ::fbthrift::Deserialize<P> for SchemaID
945where
946    P: ::fbthrift::ProtocolReader,
947{
948    fn read(p: &mut P) -> ::anyhow::Result<Self> {
949        static FIELDS: &[::fbthrift::Field] = &[
950            ::fbthrift::Field::new("edge_type", ::fbthrift::TType::I32, 2),
951            ::fbthrift::Field::new("tag_id", ::fbthrift::TType::I32, 1),
952        ];
953        let _ = p.read_struct_begin(|_| ())?;
954        let mut once = false;
955        let mut alt = ::std::option::Option::None;
956        loop {
957            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
958            match (fty, fid as ::std::primitive::i32, once) {
959                (::fbthrift::TType::Stop, _, _) => break,
960                (::fbthrift::TType::I32, 1, false) => {
961                    once = true;
962                    alt = ::std::option::Option::Some(Self::tag_id(::fbthrift::Deserialize::read(p)?));
963                }
964                (::fbthrift::TType::I32, 2, false) => {
965                    once = true;
966                    alt = ::std::option::Option::Some(Self::edge_type(::fbthrift::Deserialize::read(p)?));
967                }
968                (fty, _, false) => p.skip(fty)?,
969                (badty, badid, true) => return ::std::result::Result::Err(::std::convert::From::from(::fbthrift::ApplicationException::new(
970                    ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
971                    format!(
972                        "unwanted extra union {} field ty {:?} id {}",
973                        "SchemaID",
974                        badty,
975                        badid,
976                    ),
977                ))),
978            }
979            p.read_field_end()?;
980        }
981        p.read_struct_end()?;
982        ::std::result::Result::Ok(alt.unwrap_or_default())
983    }
984}
985
986#[allow(clippy::derivable_impls)]
987impl ::std::default::Default for self::IndexItem {
988    fn default() -> Self {
989        Self {
990            index_id: ::std::default::Default::default(),
991            index_name: ::std::default::Default::default(),
992            schema_id: ::std::default::Default::default(),
993            schema_name: ::std::default::Default::default(),
994            fields: ::std::default::Default::default(),
995            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
996        }
997    }
998}
999
1000impl ::std::fmt::Debug for self::IndexItem {
1001    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
1002        formatter
1003            .debug_struct("IndexItem")
1004            .field("index_id", &self.index_id)
1005            .field("index_name", &self.index_name)
1006            .field("schema_id", &self.schema_id)
1007            .field("schema_name", &self.schema_name)
1008            .field("fields", &self.fields)
1009            .finish()
1010    }
1011}
1012
1013unsafe impl ::std::marker::Send for self::IndexItem {}
1014unsafe impl ::std::marker::Sync for self::IndexItem {}
1015
1016impl ::fbthrift::GetTType for self::IndexItem {
1017    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
1018}
1019
1020impl<P> ::fbthrift::Serialize<P> for self::IndexItem
1021where
1022    P: ::fbthrift::ProtocolWriter,
1023{
1024    fn write(&self, p: &mut P) {
1025        p.write_struct_begin("IndexItem");
1026        p.write_field_begin("index_id", ::fbthrift::TType::I32, 1);
1027        ::fbthrift::Serialize::write(&self.index_id, p);
1028        p.write_field_end();
1029        p.write_field_begin("index_name", ::fbthrift::TType::String, 2);
1030        ::fbthrift::Serialize::write(&self.index_name, p);
1031        p.write_field_end();
1032        p.write_field_begin("schema_id", ::fbthrift::TType::Struct, 3);
1033        ::fbthrift::Serialize::write(&self.schema_id, p);
1034        p.write_field_end();
1035        p.write_field_begin("schema_name", ::fbthrift::TType::String, 4);
1036        ::fbthrift::Serialize::write(&self.schema_name, p);
1037        p.write_field_end();
1038        p.write_field_begin("fields", ::fbthrift::TType::List, 5);
1039        ::fbthrift::Serialize::write(&self.fields, p);
1040        p.write_field_end();
1041        p.write_field_stop();
1042        p.write_struct_end();
1043    }
1044}
1045
1046impl<P> ::fbthrift::Deserialize<P> for self::IndexItem
1047where
1048    P: ::fbthrift::ProtocolReader,
1049{
1050    fn read(p: &mut P) -> ::anyhow::Result<Self> {
1051        static FIELDS: &[::fbthrift::Field] = &[
1052            ::fbthrift::Field::new("fields", ::fbthrift::TType::List, 5),
1053            ::fbthrift::Field::new("index_id", ::fbthrift::TType::I32, 1),
1054            ::fbthrift::Field::new("index_name", ::fbthrift::TType::String, 2),
1055            ::fbthrift::Field::new("schema_id", ::fbthrift::TType::Struct, 3),
1056            ::fbthrift::Field::new("schema_name", ::fbthrift::TType::String, 4),
1057        ];
1058        let mut field_index_id = ::std::option::Option::None;
1059        let mut field_index_name = ::std::option::Option::None;
1060        let mut field_schema_id = ::std::option::Option::None;
1061        let mut field_schema_name = ::std::option::Option::None;
1062        let mut field_fields = ::std::option::Option::None;
1063        let _ = p.read_struct_begin(|_| ())?;
1064        loop {
1065            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
1066            match (fty, fid as ::std::primitive::i32) {
1067                (::fbthrift::TType::Stop, _) => break,
1068                (::fbthrift::TType::I32, 1) => field_index_id = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
1069                (::fbthrift::TType::String, 2) => field_index_name = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
1070                (::fbthrift::TType::Struct, 3) => field_schema_id = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
1071                (::fbthrift::TType::String, 4) => field_schema_name = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
1072                (::fbthrift::TType::List, 5) => field_fields = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
1073                (fty, _) => p.skip(fty)?,
1074            }
1075            p.read_field_end()?;
1076        }
1077        p.read_struct_end()?;
1078        ::std::result::Result::Ok(Self {
1079            index_id: field_index_id.unwrap_or_default(),
1080            index_name: field_index_name.unwrap_or_default(),
1081            schema_id: field_schema_id.unwrap_or_default(),
1082            schema_name: field_schema_name.unwrap_or_default(),
1083            fields: field_fields.unwrap_or_default(),
1084            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
1085        })
1086    }
1087}
1088
1089
1090#[allow(clippy::derivable_impls)]
1091impl ::std::default::Default for self::HostAddr {
1092    fn default() -> Self {
1093        Self {
1094            ip: ::std::default::Default::default(),
1095            port: ::std::default::Default::default(),
1096            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
1097        }
1098    }
1099}
1100
1101impl ::std::fmt::Debug for self::HostAddr {
1102    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
1103        formatter
1104            .debug_struct("HostAddr")
1105            .field("ip", &self.ip)
1106            .field("port", &self.port)
1107            .finish()
1108    }
1109}
1110
1111unsafe impl ::std::marker::Send for self::HostAddr {}
1112unsafe impl ::std::marker::Sync for self::HostAddr {}
1113
1114impl ::fbthrift::GetTType for self::HostAddr {
1115    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
1116}
1117
1118impl<P> ::fbthrift::Serialize<P> for self::HostAddr
1119where
1120    P: ::fbthrift::ProtocolWriter,
1121{
1122    fn write(&self, p: &mut P) {
1123        p.write_struct_begin("HostAddr");
1124        p.write_field_begin("ip", ::fbthrift::TType::I32, 1);
1125        ::fbthrift::Serialize::write(&self.ip, p);
1126        p.write_field_end();
1127        p.write_field_begin("port", ::fbthrift::TType::I32, 2);
1128        ::fbthrift::Serialize::write(&self.port, p);
1129        p.write_field_end();
1130        p.write_field_stop();
1131        p.write_struct_end();
1132    }
1133}
1134
1135impl<P> ::fbthrift::Deserialize<P> for self::HostAddr
1136where
1137    P: ::fbthrift::ProtocolReader,
1138{
1139    fn read(p: &mut P) -> ::anyhow::Result<Self> {
1140        static FIELDS: &[::fbthrift::Field] = &[
1141            ::fbthrift::Field::new("ip", ::fbthrift::TType::I32, 1),
1142            ::fbthrift::Field::new("port", ::fbthrift::TType::I32, 2),
1143        ];
1144        let mut field_ip = ::std::option::Option::None;
1145        let mut field_port = ::std::option::Option::None;
1146        let _ = p.read_struct_begin(|_| ())?;
1147        loop {
1148            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
1149            match (fty, fid as ::std::primitive::i32) {
1150                (::fbthrift::TType::Stop, _) => break,
1151                (::fbthrift::TType::I32, 1) => field_ip = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
1152                (::fbthrift::TType::I32, 2) => field_port = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
1153                (fty, _) => p.skip(fty)?,
1154            }
1155            p.read_field_end()?;
1156        }
1157        p.read_struct_end()?;
1158        ::std::result::Result::Ok(Self {
1159            ip: field_ip.unwrap_or_default(),
1160            port: field_port.unwrap_or_default(),
1161            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
1162        })
1163    }
1164}
1165
1166
1167#[allow(clippy::derivable_impls)]
1168impl ::std::default::Default for self::Pair {
1169    fn default() -> Self {
1170        Self {
1171            key: ::std::default::Default::default(),
1172            value: ::std::default::Default::default(),
1173            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
1174        }
1175    }
1176}
1177
1178impl ::std::fmt::Debug for self::Pair {
1179    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
1180        formatter
1181            .debug_struct("Pair")
1182            .field("key", &self.key)
1183            .field("value", &self.value)
1184            .finish()
1185    }
1186}
1187
1188unsafe impl ::std::marker::Send for self::Pair {}
1189unsafe impl ::std::marker::Sync for self::Pair {}
1190
1191impl ::fbthrift::GetTType for self::Pair {
1192    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
1193}
1194
1195impl<P> ::fbthrift::Serialize<P> for self::Pair
1196where
1197    P: ::fbthrift::ProtocolWriter,
1198{
1199    fn write(&self, p: &mut P) {
1200        p.write_struct_begin("Pair");
1201        p.write_field_begin("key", ::fbthrift::TType::String, 1);
1202        ::fbthrift::Serialize::write(&self.key, p);
1203        p.write_field_end();
1204        p.write_field_begin("value", ::fbthrift::TType::String, 2);
1205        ::fbthrift::Serialize::write(&self.value, p);
1206        p.write_field_end();
1207        p.write_field_stop();
1208        p.write_struct_end();
1209    }
1210}
1211
1212impl<P> ::fbthrift::Deserialize<P> for self::Pair
1213where
1214    P: ::fbthrift::ProtocolReader,
1215{
1216    fn read(p: &mut P) -> ::anyhow::Result<Self> {
1217        static FIELDS: &[::fbthrift::Field] = &[
1218            ::fbthrift::Field::new("key", ::fbthrift::TType::String, 1),
1219            ::fbthrift::Field::new("value", ::fbthrift::TType::String, 2),
1220        ];
1221        let mut field_key = ::std::option::Option::None;
1222        let mut field_value = ::std::option::Option::None;
1223        let _ = p.read_struct_begin(|_| ())?;
1224        loop {
1225            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
1226            match (fty, fid as ::std::primitive::i32) {
1227                (::fbthrift::TType::Stop, _) => break,
1228                (::fbthrift::TType::String, 1) => field_key = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
1229                (::fbthrift::TType::String, 2) => field_value = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
1230                (fty, _) => p.skip(fty)?,
1231            }
1232            p.read_field_end()?;
1233        }
1234        p.read_struct_end()?;
1235        ::std::result::Result::Ok(Self {
1236            key: field_key.unwrap_or_default(),
1237            value: field_value.unwrap_or_default(),
1238            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
1239        })
1240    }
1241}
1242
1243
1244#[allow(clippy::derivable_impls)]
1245impl ::std::default::Default for self::RoleItem {
1246    fn default() -> Self {
1247        Self {
1248            user: ::std::default::Default::default(),
1249            space_id: ::std::default::Default::default(),
1250            role_type: ::std::default::Default::default(),
1251            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
1252        }
1253    }
1254}
1255
1256impl ::std::fmt::Debug for self::RoleItem {
1257    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
1258        formatter
1259            .debug_struct("RoleItem")
1260            .field("user", &self.user)
1261            .field("space_id", &self.space_id)
1262            .field("role_type", &self.role_type)
1263            .finish()
1264    }
1265}
1266
1267unsafe impl ::std::marker::Send for self::RoleItem {}
1268unsafe impl ::std::marker::Sync for self::RoleItem {}
1269
1270impl ::fbthrift::GetTType for self::RoleItem {
1271    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
1272}
1273
1274impl<P> ::fbthrift::Serialize<P> for self::RoleItem
1275where
1276    P: ::fbthrift::ProtocolWriter,
1277{
1278    fn write(&self, p: &mut P) {
1279        p.write_struct_begin("RoleItem");
1280        p.write_field_begin("user", ::fbthrift::TType::String, 1);
1281        ::fbthrift::Serialize::write(&self.user, p);
1282        p.write_field_end();
1283        p.write_field_begin("space_id", ::fbthrift::TType::I32, 2);
1284        ::fbthrift::Serialize::write(&self.space_id, p);
1285        p.write_field_end();
1286        p.write_field_begin("role_type", ::fbthrift::TType::I32, 3);
1287        ::fbthrift::Serialize::write(&self.role_type, p);
1288        p.write_field_end();
1289        p.write_field_stop();
1290        p.write_struct_end();
1291    }
1292}
1293
1294impl<P> ::fbthrift::Deserialize<P> for self::RoleItem
1295where
1296    P: ::fbthrift::ProtocolReader,
1297{
1298    fn read(p: &mut P) -> ::anyhow::Result<Self> {
1299        static FIELDS: &[::fbthrift::Field] = &[
1300            ::fbthrift::Field::new("role_type", ::fbthrift::TType::I32, 3),
1301            ::fbthrift::Field::new("space_id", ::fbthrift::TType::I32, 2),
1302            ::fbthrift::Field::new("user", ::fbthrift::TType::String, 1),
1303        ];
1304        let mut field_user = ::std::option::Option::None;
1305        let mut field_space_id = ::std::option::Option::None;
1306        let mut field_role_type = ::std::option::Option::None;
1307        let _ = p.read_struct_begin(|_| ())?;
1308        loop {
1309            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
1310            match (fty, fid as ::std::primitive::i32) {
1311                (::fbthrift::TType::Stop, _) => break,
1312                (::fbthrift::TType::String, 1) => field_user = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
1313                (::fbthrift::TType::I32, 2) => field_space_id = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
1314                (::fbthrift::TType::I32, 3) => field_role_type = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
1315                (fty, _) => p.skip(fty)?,
1316            }
1317            p.read_field_end()?;
1318        }
1319        p.read_struct_end()?;
1320        ::std::result::Result::Ok(Self {
1321            user: field_user.unwrap_or_default(),
1322            space_id: field_space_id.unwrap_or_default(),
1323            role_type: field_role_type.unwrap_or_default(),
1324            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
1325        })
1326    }
1327}
1328
1329
1330mod dot_dot {
1331    #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1332    pub struct OtherFields(pub(crate) ());
1333
1334    #[allow(dead_code)] // if serde isn't being used
1335    pub(super) fn default_for_serde_deserialize() -> OtherFields {
1336        OtherFields(())
1337    }
1338}