// @generated by Thrift for thrift/compiler/test/fixtures/types/src/module.thrift
// This file is probably not the place you want to edit!

//! Thrift type definitions for `module`.

#![allow(clippy::redundant_closure)]

pub type TBinary = ::std::vec::Vec<::std::primitive::u8>;

pub type IntTypedef = ::std::primitive::i32;

pub type UintTypedef = crate::types::IntTypedef;

#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct empty_struct {
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct decorated_struct {
    pub field: ::std::string::String,
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq)]
pub struct ContainerStruct {
    pub fieldA: ::std::vec::Vec<::std::primitive::i32>,
    pub fieldB: ::std::vec::Vec<::std::primitive::i32>,
    pub fieldC: ::std::vec::Vec<::std::primitive::i32>,
    pub fieldD: ::std::vec::Vec<::std::primitive::i32>,
    pub fieldE: ::std::vec::Vec<::std::primitive::i32>,
    pub fieldF: ::sorted_vector_map::SortedVectorSet<::std::primitive::i32>,
    pub fieldG: ::sorted_vector_map::SortedVectorMap<::std::primitive::i32, ::std::string::String>,
    pub fieldH: included::types::SomeMap,
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct CppTypeStruct {
    pub fieldA: ::std::vec::Vec<::std::primitive::i32>,
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct VirtualStruct {
    pub MyIntField: ::std::primitive::i64,
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct MyStructWithForwardRefEnum {
    pub a: crate::types::MyForwardRefEnum,
    pub b: crate::types::MyForwardRefEnum,
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct TrivialNumeric {
    pub a: ::std::primitive::i32,
    pub b: ::std::primitive::bool,
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq)]
pub struct TrivialNestedWithDefault {
    pub z: ::std::primitive::i32,
    pub n: crate::types::TrivialNumeric,
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq)]
pub struct ComplexString {
    pub a: ::std::string::String,
    pub b: ::std::collections::BTreeMap<::std::string::String, ::std::primitive::i32>,
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq)]
pub struct ComplexNestedWithDefault {
    pub z: ::std::string::String,
    pub n: crate::types::ComplexString,
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct MinPadding {
    pub small: ::std::primitive::i8,
    pub big: ::std::primitive::i64,
    pub medium: ::std::primitive::i16,
    pub biggish: ::std::primitive::i32,
    pub tiny: ::std::primitive::i8,
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct MinPaddingWithCustomType {
    pub small: ::std::primitive::i8,
    pub big: ::std::primitive::i64,
    pub medium: ::std::primitive::i16,
    pub biggish: ::std::primitive::i32,
    pub tiny: ::std::primitive::i8,
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq)]
pub struct MyStruct {
    pub MyIntField: ::std::primitive::i64,
    pub MyStringField: ::std::string::String,
    pub majorVer: ::std::primitive::i64,
    pub data: crate::types::MyDataItem,
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct MyDataItem {
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Renaming {
    pub foo: ::std::primitive::i64,
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq)]
pub struct AnnotatedTypes {
    pub binary_field: crate::types::TBinary,
    pub list_field: included::types::SomeListOfTypeMap,
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq)]
pub struct ForwardUsageRoot {
    pub ForwardUsageStruct: ::std::option::Option<crate::types::ForwardUsageStruct>,
    pub ForwardUsageByRef: ::std::option::Option<crate::types::ForwardUsageByRef>,
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq)]
pub struct ForwardUsageStruct {
    pub foo: ::std::option::Option<crate::types::ForwardUsageRoot>,
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq)]
pub struct ForwardUsageByRef {
    pub foo: ::std::option::Option<crate::types::ForwardUsageRoot>,
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq)]
pub struct IncompleteMap {
    pub field: ::std::option::Option<::std::collections::BTreeMap<::std::primitive::i32, crate::types::IncompleteMapDep>>,
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct IncompleteMapDep {
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq)]
pub struct CompleteMap {
    pub field: ::std::option::Option<::std::collections::BTreeMap<::std::primitive::i32, crate::types::CompleteMapDep>>,
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct CompleteMapDep {
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq)]
pub struct IncompleteList {
    pub field: ::std::option::Option<::std::vec::Vec<crate::types::IncompleteListDep>>,
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct IncompleteListDep {
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq)]
pub struct CompleteList {
    pub field: ::std::option::Option<::std::vec::Vec<crate::types::CompleteListDep>>,
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct CompleteListDep {
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq)]
pub struct AdaptedList {
    pub field: ::std::option::Option<::std::vec::Vec<crate::types::AdaptedListDep>>,
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq)]
pub struct AdaptedListDep {
    pub field: crate::types::AdaptedList,
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq)]
pub struct DependentAdaptedList {
    pub field: ::std::option::Option<::std::vec::Vec<crate::types::DependentAdaptedListDep>>,
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct DependentAdaptedListDep {
    pub field: ::std::option::Option<::std::boxed::Box<::std::primitive::i16>>,
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq)]
pub struct AllocatorAware {
    pub aa_list: ::std::vec::Vec<::std::primitive::i32>,
    pub aa_set: ::std::collections::BTreeSet<::std::primitive::i32>,
    pub aa_map: ::std::collections::BTreeMap<::std::primitive::i32, ::std::primitive::i32>,
    pub aa_string: ::std::string::String,
    pub not_a_container: ::std::primitive::i32,
    pub aa_unique: ::std::primitive::i32,
    pub aa_shared: ::std::primitive::i32,
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct AllocatorAware2 {
    pub not_a_container: ::std::primitive::i32,
    pub box_field: ::std::option::Option<::std::boxed::Box<::std::primitive::i32>>,
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct TypedefStruct {
    pub i32_field: ::std::primitive::i32,
    pub IntTypedef_field: crate::types::IntTypedef,
    pub UintTypedef_field: crate::types::UintTypedef,
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct StructWithDoubleUnderscores {
    pub __field: ::std::primitive::i32,
    // This field forces `..Default::default()` when instantiating this
    // struct, to make code future-proof against new fields added later to
    // the definition in Thrift. If you don't want this, add the annotation
    // `(rust.exhaustive)` to the Thrift struct to eliminate this field.
    #[doc(hidden)]
    pub _dot_dot_Default_default: self::dot_dot::OtherFields,
}

#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct has_bitwise_ops(pub ::std::primitive::i32);

impl has_bitwise_ops {
    pub const none: Self = has_bitwise_ops(0i32);
    pub const zero: Self = has_bitwise_ops(1i32);
    pub const one: Self = has_bitwise_ops(2i32);
    pub const two: Self = has_bitwise_ops(4i32);
    pub const three: Self = has_bitwise_ops(8i32);
}

impl ::fbthrift::ThriftEnum for has_bitwise_ops {
    fn enumerate() -> &'static [(Self, &'static str)] {
        &[
            (Self::none, "none"),
            (Self::zero, "zero"),
            (Self::one, "one"),
            (Self::two, "two"),
            (Self::three, "three"),
        ]
    }

    fn variants() -> &'static [&'static str] {
        &[
            "none",
            "zero",
            "one",
            "two",
            "three",
        ]
    }

    fn variant_values() -> &'static [Self] {
        &[
            Self::none,
            Self::zero,
            Self::one,
            Self::two,
            Self::three,
        ]
    }
}

impl ::std::default::Default for has_bitwise_ops {
    fn default() -> Self {
        Self(::fbthrift::__UNKNOWN_ID)
    }
}

impl<'a> ::std::convert::From<&'a has_bitwise_ops> for ::std::primitive::i32 {
    #[inline]
    fn from(x: &'a has_bitwise_ops) -> Self {
        x.0
    }
}

impl ::std::convert::From<has_bitwise_ops> for ::std::primitive::i32 {
    #[inline]
    fn from(x: has_bitwise_ops) -> Self {
        x.0
    }
}

impl ::std::convert::From<::std::primitive::i32> for has_bitwise_ops {
    #[inline]
    fn from(x: ::std::primitive::i32) -> Self {
        Self(x)
    }
}

impl ::std::fmt::Display for has_bitwise_ops {
    fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        static VARIANTS_BY_NUMBER: &[(&::std::primitive::str, ::std::primitive::i32)] = &[
            ("none", 0),
            ("zero", 1),
            ("one", 2),
            ("two", 4),
            ("three", 8),
        ];
        ::fbthrift::help::enum_display(VARIANTS_BY_NUMBER, fmt, self.0)
    }
}

impl ::std::fmt::Debug for has_bitwise_ops {
    fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        write!(fmt, "has_bitwise_ops::{}", self)
    }
}

impl ::std::str::FromStr for has_bitwise_ops {
    type Err = ::anyhow::Error;

    fn from_str(string: &::std::primitive::str) -> ::std::result::Result<Self, Self::Err> {
        static VARIANTS_BY_NAME: &[(&::std::primitive::str, ::std::primitive::i32)] = &[
            ("none", 0),
            ("one", 2),
            ("three", 8),
            ("two", 4),
            ("zero", 1),
        ];
        ::fbthrift::help::enum_from_str(VARIANTS_BY_NAME, string, "has_bitwise_ops").map(Self)
    }
}

impl ::fbthrift::GetTType for has_bitwise_ops {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::I32;
}

impl ::fbthrift::GetUri for self::has_bitwise_ops {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/has_bitwise_ops"
    }
}

impl<P> ::fbthrift::Serialize<P> for has_bitwise_ops
where
    P: ::fbthrift::ProtocolWriter,
{
    #[inline]
    fn write(&self, p: &mut P) {
        p.write_i32(self.into())
    }
}

impl<P> ::fbthrift::Deserialize<P> for has_bitwise_ops
where
    P: ::fbthrift::ProtocolReader,
{
    #[inline]
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        ::std::result::Result::Ok(Self::from(p.read_i32()?))
    }
}

#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct is_unscoped(pub ::std::primitive::i32);

impl is_unscoped {
    pub const hello: Self = is_unscoped(0i32);
    pub const world: Self = is_unscoped(1i32);
}

impl ::fbthrift::ThriftEnum for is_unscoped {
    fn enumerate() -> &'static [(Self, &'static str)] {
        &[
            (Self::hello, "hello"),
            (Self::world, "world"),
        ]
    }

    fn variants() -> &'static [&'static str] {
        &[
            "hello",
            "world",
        ]
    }

    fn variant_values() -> &'static [Self] {
        &[
            Self::hello,
            Self::world,
        ]
    }
}

impl ::std::default::Default for is_unscoped {
    fn default() -> Self {
        Self(::fbthrift::__UNKNOWN_ID)
    }
}

impl<'a> ::std::convert::From<&'a is_unscoped> for ::std::primitive::i32 {
    #[inline]
    fn from(x: &'a is_unscoped) -> Self {
        x.0
    }
}

impl ::std::convert::From<is_unscoped> for ::std::primitive::i32 {
    #[inline]
    fn from(x: is_unscoped) -> Self {
        x.0
    }
}

impl ::std::convert::From<::std::primitive::i32> for is_unscoped {
    #[inline]
    fn from(x: ::std::primitive::i32) -> Self {
        Self(x)
    }
}

impl ::std::fmt::Display for is_unscoped {
    fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        static VARIANTS_BY_NUMBER: &[(&::std::primitive::str, ::std::primitive::i32)] = &[
            ("hello", 0),
            ("world", 1),
        ];
        ::fbthrift::help::enum_display(VARIANTS_BY_NUMBER, fmt, self.0)
    }
}

impl ::std::fmt::Debug for is_unscoped {
    fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        write!(fmt, "is_unscoped::{}", self)
    }
}

impl ::std::str::FromStr for is_unscoped {
    type Err = ::anyhow::Error;

    fn from_str(string: &::std::primitive::str) -> ::std::result::Result<Self, Self::Err> {
        static VARIANTS_BY_NAME: &[(&::std::primitive::str, ::std::primitive::i32)] = &[
            ("hello", 0),
            ("world", 1),
        ];
        ::fbthrift::help::enum_from_str(VARIANTS_BY_NAME, string, "is_unscoped").map(Self)
    }
}

impl ::fbthrift::GetTType for is_unscoped {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::I32;
}

impl ::fbthrift::GetUri for self::is_unscoped {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/is_unscoped"
    }
}

impl<P> ::fbthrift::Serialize<P> for is_unscoped
where
    P: ::fbthrift::ProtocolWriter,
{
    #[inline]
    fn write(&self, p: &mut P) {
        p.write_i32(self.into())
    }
}

impl<P> ::fbthrift::Deserialize<P> for is_unscoped
where
    P: ::fbthrift::ProtocolReader,
{
    #[inline]
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        ::std::result::Result::Ok(Self::from(p.read_i32()?))
    }
}

#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct MyForwardRefEnum(pub ::std::primitive::i32);

impl MyForwardRefEnum {
    pub const ZERO: Self = MyForwardRefEnum(0i32);
    pub const NONZERO: Self = MyForwardRefEnum(12i32);
}

impl ::fbthrift::ThriftEnum for MyForwardRefEnum {
    fn enumerate() -> &'static [(Self, &'static str)] {
        &[
            (Self::ZERO, "ZERO"),
            (Self::NONZERO, "NONZERO"),
        ]
    }

    fn variants() -> &'static [&'static str] {
        &[
            "ZERO",
            "NONZERO",
        ]
    }

    fn variant_values() -> &'static [Self] {
        &[
            Self::ZERO,
            Self::NONZERO,
        ]
    }
}

impl ::std::default::Default for MyForwardRefEnum {
    fn default() -> Self {
        Self(::fbthrift::__UNKNOWN_ID)
    }
}

impl<'a> ::std::convert::From<&'a MyForwardRefEnum> for ::std::primitive::i32 {
    #[inline]
    fn from(x: &'a MyForwardRefEnum) -> Self {
        x.0
    }
}

impl ::std::convert::From<MyForwardRefEnum> for ::std::primitive::i32 {
    #[inline]
    fn from(x: MyForwardRefEnum) -> Self {
        x.0
    }
}

impl ::std::convert::From<::std::primitive::i32> for MyForwardRefEnum {
    #[inline]
    fn from(x: ::std::primitive::i32) -> Self {
        Self(x)
    }
}

impl ::std::fmt::Display for MyForwardRefEnum {
    fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        static VARIANTS_BY_NUMBER: &[(&::std::primitive::str, ::std::primitive::i32)] = &[
            ("ZERO", 0),
            ("NONZERO", 12),
        ];
        ::fbthrift::help::enum_display(VARIANTS_BY_NUMBER, fmt, self.0)
    }
}

impl ::std::fmt::Debug for MyForwardRefEnum {
    fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        write!(fmt, "MyForwardRefEnum::{}", self)
    }
}

impl ::std::str::FromStr for MyForwardRefEnum {
    type Err = ::anyhow::Error;

    fn from_str(string: &::std::primitive::str) -> ::std::result::Result<Self, Self::Err> {
        static VARIANTS_BY_NAME: &[(&::std::primitive::str, ::std::primitive::i32)] = &[
            ("NONZERO", 12),
            ("ZERO", 0),
        ];
        ::fbthrift::help::enum_from_str(VARIANTS_BY_NAME, string, "MyForwardRefEnum").map(Self)
    }
}

impl ::fbthrift::GetTType for MyForwardRefEnum {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::I32;
}

impl ::fbthrift::GetUri for self::MyForwardRefEnum {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/MyForwardRefEnum"
    }
}

impl<P> ::fbthrift::Serialize<P> for MyForwardRefEnum
where
    P: ::fbthrift::ProtocolWriter,
{
    #[inline]
    fn write(&self, p: &mut P) {
        p.write_i32(self.into())
    }
}

impl<P> ::fbthrift::Deserialize<P> for MyForwardRefEnum
where
    P: ::fbthrift::ProtocolReader,
{
    #[inline]
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        ::std::result::Result::Ok(Self::from(p.read_i32()?))
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::empty_struct {
    fn default() -> Self {
        Self {
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::empty_struct {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("empty_struct")
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::empty_struct {}
unsafe impl ::std::marker::Sync for self::empty_struct {}
impl ::std::marker::Unpin for self::empty_struct {}

impl ::fbthrift::GetTType for self::empty_struct {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::empty_struct {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/empty_struct"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::empty_struct
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("empty_struct");
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::empty_struct
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
        ];
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for empty_struct {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::decorated_struct {
    fn default() -> Self {
        Self {
            field: ::std::default::Default::default(),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::decorated_struct {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("decorated_struct")
            .field("field", &self.field)
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::decorated_struct {}
unsafe impl ::std::marker::Sync for self::decorated_struct {}
impl ::std::marker::Unpin for self::decorated_struct {}

impl ::fbthrift::GetTType for self::decorated_struct {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::decorated_struct {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/decorated_struct"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::decorated_struct
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("decorated_struct");
        p.write_field_begin("field", ::fbthrift::TType::String, 1);
        ::fbthrift::Serialize::write(&self.field, p);
        p.write_field_end();
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::decorated_struct
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
            ::fbthrift::Field::new("field", ::fbthrift::TType::String, 1),
        ];
        let mut field_field = ::std::option::Option::None;
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (::fbthrift::TType::String, 1) => field_field = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            field: field_field.unwrap_or_default(),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for decorated_struct {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            1 => {
            },
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::ContainerStruct {
    fn default() -> Self {
        Self {
            fieldA: ::std::default::Default::default(),
            fieldB: ::std::default::Default::default(),
            fieldC: ::std::default::Default::default(),
            fieldD: ::std::default::Default::default(),
            fieldE: ::std::default::Default::default(),
            fieldF: ::std::default::Default::default(),
            fieldG: ::std::default::Default::default(),
            fieldH: ::std::default::Default::default(),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::ContainerStruct {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("ContainerStruct")
            .field("fieldA", &self.fieldA)
            .field("fieldB", &self.fieldB)
            .field("fieldC", &self.fieldC)
            .field("fieldD", &self.fieldD)
            .field("fieldE", &self.fieldE)
            .field("fieldF", &self.fieldF)
            .field("fieldG", &self.fieldG)
            .field("fieldH", &self.fieldH)
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::ContainerStruct {}
unsafe impl ::std::marker::Sync for self::ContainerStruct {}
impl ::std::marker::Unpin for self::ContainerStruct {}

impl ::fbthrift::GetTType for self::ContainerStruct {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::ContainerStruct {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/ContainerStruct"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::ContainerStruct
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("ContainerStruct");
        p.write_field_begin("fieldA", ::fbthrift::TType::List, 12);
        ::fbthrift::Serialize::write(&self.fieldA, p);
        p.write_field_end();
        p.write_field_begin("fieldB", ::fbthrift::TType::List, 2);
        ::fbthrift::Serialize::write(&self.fieldB, p);
        p.write_field_end();
        p.write_field_begin("fieldC", ::fbthrift::TType::List, 3);
        ::fbthrift::Serialize::write(&self.fieldC, p);
        p.write_field_end();
        p.write_field_begin("fieldD", ::fbthrift::TType::List, 4);
        ::fbthrift::Serialize::write(&self.fieldD, p);
        p.write_field_end();
        p.write_field_begin("fieldE", ::fbthrift::TType::List, 5);
        ::fbthrift::Serialize::write(&self.fieldE, p);
        p.write_field_end();
        p.write_field_begin("fieldF", ::fbthrift::TType::Set, 6);
        super::r#impl::write(&self.fieldF, p);
        p.write_field_end();
        p.write_field_begin("fieldG", ::fbthrift::TType::Map, 7);
        super::r#impl::write(&self.fieldG, p);
        p.write_field_end();
        p.write_field_begin("fieldH", ::fbthrift::TType::Map, 8);
        ::fbthrift::Serialize::write(&self.fieldH, p);
        p.write_field_end();
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::ContainerStruct
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
            ::fbthrift::Field::new("fieldA", ::fbthrift::TType::List, 12),
            ::fbthrift::Field::new("fieldB", ::fbthrift::TType::List, 2),
            ::fbthrift::Field::new("fieldC", ::fbthrift::TType::List, 3),
            ::fbthrift::Field::new("fieldD", ::fbthrift::TType::List, 4),
            ::fbthrift::Field::new("fieldE", ::fbthrift::TType::List, 5),
            ::fbthrift::Field::new("fieldF", ::fbthrift::TType::Set, 6),
            ::fbthrift::Field::new("fieldG", ::fbthrift::TType::Map, 7),
            ::fbthrift::Field::new("fieldH", ::fbthrift::TType::Map, 8),
        ];
        let mut field_fieldA = ::std::option::Option::None;
        let mut field_fieldB = ::std::option::Option::None;
        let mut field_fieldC = ::std::option::Option::None;
        let mut field_fieldD = ::std::option::Option::None;
        let mut field_fieldE = ::std::option::Option::None;
        let mut field_fieldF = ::std::option::Option::None;
        let mut field_fieldG = ::std::option::Option::None;
        let mut field_fieldH = ::std::option::Option::None;
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (::fbthrift::TType::List, 12) => field_fieldA = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::List, 2) => field_fieldB = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::List, 3) => field_fieldC = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::List, 4) => field_fieldD = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::List, 5) => field_fieldE = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::Set, 6) => field_fieldF = ::std::option::Option::Some(super::r#impl::read(p)?),
                (::fbthrift::TType::Map, 7) => field_fieldG = ::std::option::Option::Some(super::r#impl::read(p)?),
                (::fbthrift::TType::Map, 8) => field_fieldH = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            fieldA: field_fieldA.unwrap_or_default(),
            fieldB: field_fieldB.unwrap_or_default(),
            fieldC: field_fieldC.unwrap_or_default(),
            fieldD: field_fieldD.unwrap_or_default(),
            fieldE: field_fieldE.unwrap_or_default(),
            fieldF: field_fieldF.unwrap_or_default(),
            fieldG: field_fieldG.unwrap_or_default(),
            fieldH: field_fieldH.unwrap_or_default(),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for ContainerStruct {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            12 => {
            },
            2 => {

                if type_id == ::std::any::TypeId::of::<cpp::types::Type>() {
                    let mut tmp = Some(cpp::types::Type {
                        name: ::std::default::Default::default(),
                        template: "std::list".to_owned(),
                        ..::std::default::Default::default()
                    });
                    let r: &mut dyn ::std::any::Any = &mut tmp;
                    let r: &mut Option<T> = r.downcast_mut().unwrap();
                    return r.take();
                }
            },
            3 => {
            },
            4 => {
            },
            5 => {
            },
            6 => {
            },
            7 => {
            },
            8 => {
            },
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::CppTypeStruct {
    fn default() -> Self {
        Self {
            fieldA: ::std::default::Default::default(),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::CppTypeStruct {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("CppTypeStruct")
            .field("fieldA", &self.fieldA)
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::CppTypeStruct {}
unsafe impl ::std::marker::Sync for self::CppTypeStruct {}
impl ::std::marker::Unpin for self::CppTypeStruct {}

impl ::fbthrift::GetTType for self::CppTypeStruct {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::CppTypeStruct {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/CppTypeStruct"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::CppTypeStruct
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("CppTypeStruct");
        p.write_field_begin("fieldA", ::fbthrift::TType::List, 1);
        ::fbthrift::Serialize::write(&self.fieldA, p);
        p.write_field_end();
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::CppTypeStruct
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
            ::fbthrift::Field::new("fieldA", ::fbthrift::TType::List, 1),
        ];
        let mut field_fieldA = ::std::option::Option::None;
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (::fbthrift::TType::List, 1) => field_fieldA = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            fieldA: field_fieldA.unwrap_or_default(),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for CppTypeStruct {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            1 => {
            },
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::VirtualStruct {
    fn default() -> Self {
        Self {
            MyIntField: ::std::default::Default::default(),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::VirtualStruct {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("VirtualStruct")
            .field("MyIntField", &self.MyIntField)
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::VirtualStruct {}
unsafe impl ::std::marker::Sync for self::VirtualStruct {}
impl ::std::marker::Unpin for self::VirtualStruct {}

impl ::fbthrift::GetTType for self::VirtualStruct {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::VirtualStruct {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/VirtualStruct"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::VirtualStruct
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("VirtualStruct");
        p.write_field_begin("MyIntField", ::fbthrift::TType::I64, 1);
        ::fbthrift::Serialize::write(&self.MyIntField, p);
        p.write_field_end();
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::VirtualStruct
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
            ::fbthrift::Field::new("MyIntField", ::fbthrift::TType::I64, 1),
        ];
        let mut field_MyIntField = ::std::option::Option::None;
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (::fbthrift::TType::I64, 1) => field_MyIntField = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            MyIntField: field_MyIntField.unwrap_or_default(),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for VirtualStruct {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            1 => {
            },
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::MyStructWithForwardRefEnum {
    fn default() -> Self {
        Self {
            a: crate::types::MyForwardRefEnum::NONZERO,
            b: crate::types::MyForwardRefEnum::NONZERO,
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::MyStructWithForwardRefEnum {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("MyStructWithForwardRefEnum")
            .field("a", &self.a)
            .field("b", &self.b)
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::MyStructWithForwardRefEnum {}
unsafe impl ::std::marker::Sync for self::MyStructWithForwardRefEnum {}
impl ::std::marker::Unpin for self::MyStructWithForwardRefEnum {}

impl ::fbthrift::GetTType for self::MyStructWithForwardRefEnum {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::MyStructWithForwardRefEnum {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/MyStructWithForwardRefEnum"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::MyStructWithForwardRefEnum
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("MyStructWithForwardRefEnum");
        p.write_field_begin("a", ::fbthrift::TType::I32, 1);
        ::fbthrift::Serialize::write(&self.a, p);
        p.write_field_end();
        p.write_field_begin("b", ::fbthrift::TType::I32, 2);
        ::fbthrift::Serialize::write(&self.b, p);
        p.write_field_end();
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::MyStructWithForwardRefEnum
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
            ::fbthrift::Field::new("a", ::fbthrift::TType::I32, 1),
            ::fbthrift::Field::new("b", ::fbthrift::TType::I32, 2),
        ];
        let mut field_a = ::std::option::Option::None;
        let mut field_b = ::std::option::Option::None;
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (::fbthrift::TType::I32, 1) => field_a = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::I32, 2) => field_b = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            a: field_a.unwrap_or(crate::types::MyForwardRefEnum::NONZERO),
            b: field_b.unwrap_or(crate::types::MyForwardRefEnum::NONZERO),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for MyStructWithForwardRefEnum {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            1 => {
            },
            2 => {
            },
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::TrivialNumeric {
    fn default() -> Self {
        Self {
            a: ::std::default::Default::default(),
            b: ::std::default::Default::default(),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::TrivialNumeric {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("TrivialNumeric")
            .field("a", &self.a)
            .field("b", &self.b)
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::TrivialNumeric {}
unsafe impl ::std::marker::Sync for self::TrivialNumeric {}
impl ::std::marker::Unpin for self::TrivialNumeric {}

impl ::fbthrift::GetTType for self::TrivialNumeric {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::TrivialNumeric {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/TrivialNumeric"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::TrivialNumeric
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("TrivialNumeric");
        p.write_field_begin("a", ::fbthrift::TType::I32, 1);
        ::fbthrift::Serialize::write(&self.a, p);
        p.write_field_end();
        p.write_field_begin("b", ::fbthrift::TType::Bool, 2);
        ::fbthrift::Serialize::write(&self.b, p);
        p.write_field_end();
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::TrivialNumeric
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
            ::fbthrift::Field::new("a", ::fbthrift::TType::I32, 1),
            ::fbthrift::Field::new("b", ::fbthrift::TType::Bool, 2),
        ];
        let mut field_a = ::std::option::Option::None;
        let mut field_b = ::std::option::Option::None;
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (::fbthrift::TType::I32, 1) => field_a = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::Bool, 2) => field_b = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            a: field_a.unwrap_or_default(),
            b: field_b.unwrap_or_default(),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for TrivialNumeric {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            1 => {
            },
            2 => {
            },
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::TrivialNestedWithDefault {
    fn default() -> Self {
        Self {
            z: 4,
            n: crate::types::TrivialNumeric {
                    a: 3,
                    b: true,
                    ..::std::default::Default::default()
                },
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::TrivialNestedWithDefault {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("TrivialNestedWithDefault")
            .field("z", &self.z)
            .field("n", &self.n)
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::TrivialNestedWithDefault {}
unsafe impl ::std::marker::Sync for self::TrivialNestedWithDefault {}
impl ::std::marker::Unpin for self::TrivialNestedWithDefault {}

impl ::fbthrift::GetTType for self::TrivialNestedWithDefault {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::TrivialNestedWithDefault {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/TrivialNestedWithDefault"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::TrivialNestedWithDefault
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("TrivialNestedWithDefault");
        p.write_field_begin("z", ::fbthrift::TType::I32, 1);
        ::fbthrift::Serialize::write(&self.z, p);
        p.write_field_end();
        p.write_field_begin("n", ::fbthrift::TType::Struct, 2);
        ::fbthrift::Serialize::write(&self.n, p);
        p.write_field_end();
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::TrivialNestedWithDefault
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
            ::fbthrift::Field::new("n", ::fbthrift::TType::Struct, 2),
            ::fbthrift::Field::new("z", ::fbthrift::TType::I32, 1),
        ];
        let mut field_z = ::std::option::Option::None;
        let mut field_n = ::std::option::Option::None;
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (::fbthrift::TType::I32, 1) => field_z = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::Struct, 2) => field_n = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            z: field_z.unwrap_or(4),
            n: field_n.unwrap_or_else(|| crate::types::TrivialNumeric {
                    a: 3,
                    b: true,
                    ..::std::default::Default::default()
                }),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for TrivialNestedWithDefault {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            1 => {
            },
            2 => {
            },
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::ComplexString {
    fn default() -> Self {
        Self {
            a: ::std::default::Default::default(),
            b: ::std::default::Default::default(),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::ComplexString {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("ComplexString")
            .field("a", &self.a)
            .field("b", &self.b)
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::ComplexString {}
unsafe impl ::std::marker::Sync for self::ComplexString {}
impl ::std::marker::Unpin for self::ComplexString {}

impl ::fbthrift::GetTType for self::ComplexString {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::ComplexString {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/ComplexString"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::ComplexString
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("ComplexString");
        p.write_field_begin("a", ::fbthrift::TType::String, 1);
        ::fbthrift::Serialize::write(&self.a, p);
        p.write_field_end();
        p.write_field_begin("b", ::fbthrift::TType::Map, 2);
        ::fbthrift::Serialize::write(&self.b, p);
        p.write_field_end();
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::ComplexString
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
            ::fbthrift::Field::new("a", ::fbthrift::TType::String, 1),
            ::fbthrift::Field::new("b", ::fbthrift::TType::Map, 2),
        ];
        let mut field_a = ::std::option::Option::None;
        let mut field_b = ::std::option::Option::None;
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (::fbthrift::TType::String, 1) => field_a = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::Map, 2) => field_b = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            a: field_a.unwrap_or_default(),
            b: field_b.unwrap_or_default(),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for ComplexString {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            1 => {
            },
            2 => {
            },
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::ComplexNestedWithDefault {
    fn default() -> Self {
        Self {
            z: "4".to_owned(),
            n: crate::types::ComplexString {
                    a: "3".to_owned(),
                    b: {
                        let mut map = ::std::collections::BTreeMap::new();
                        map.insert("a".to_owned(), 3);
                        map
                    },
                    ..::std::default::Default::default()
                },
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::ComplexNestedWithDefault {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("ComplexNestedWithDefault")
            .field("z", &self.z)
            .field("n", &self.n)
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::ComplexNestedWithDefault {}
unsafe impl ::std::marker::Sync for self::ComplexNestedWithDefault {}
impl ::std::marker::Unpin for self::ComplexNestedWithDefault {}

impl ::fbthrift::GetTType for self::ComplexNestedWithDefault {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::ComplexNestedWithDefault {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/ComplexNestedWithDefault"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::ComplexNestedWithDefault
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("ComplexNestedWithDefault");
        p.write_field_begin("z", ::fbthrift::TType::String, 1);
        ::fbthrift::Serialize::write(&self.z, p);
        p.write_field_end();
        p.write_field_begin("n", ::fbthrift::TType::Struct, 2);
        ::fbthrift::Serialize::write(&self.n, p);
        p.write_field_end();
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::ComplexNestedWithDefault
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
            ::fbthrift::Field::new("n", ::fbthrift::TType::Struct, 2),
            ::fbthrift::Field::new("z", ::fbthrift::TType::String, 1),
        ];
        let mut field_z = ::std::option::Option::None;
        let mut field_n = ::std::option::Option::None;
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (::fbthrift::TType::String, 1) => field_z = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::Struct, 2) => field_n = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            z: field_z.unwrap_or_else(|| "4".to_owned()),
            n: field_n.unwrap_or_else(|| crate::types::ComplexString {
                    a: "3".to_owned(),
                    b: {
                        let mut map = ::std::collections::BTreeMap::new();
                        map.insert("a".to_owned(), 3);
                        map
                    },
                    ..::std::default::Default::default()
                }),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for ComplexNestedWithDefault {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            1 => {
            },
            2 => {
            },
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::MinPadding {
    fn default() -> Self {
        Self {
            small: ::std::default::Default::default(),
            big: ::std::default::Default::default(),
            medium: ::std::default::Default::default(),
            biggish: ::std::default::Default::default(),
            tiny: ::std::default::Default::default(),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::MinPadding {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("MinPadding")
            .field("small", &self.small)
            .field("big", &self.big)
            .field("medium", &self.medium)
            .field("biggish", &self.biggish)
            .field("tiny", &self.tiny)
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::MinPadding {}
unsafe impl ::std::marker::Sync for self::MinPadding {}
impl ::std::marker::Unpin for self::MinPadding {}

impl ::fbthrift::GetTType for self::MinPadding {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::MinPadding {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/MinPadding"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::MinPadding
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("MinPadding");
        p.write_field_begin("small", ::fbthrift::TType::Byte, 1);
        ::fbthrift::Serialize::write(&self.small, p);
        p.write_field_end();
        p.write_field_begin("big", ::fbthrift::TType::I64, 2);
        ::fbthrift::Serialize::write(&self.big, p);
        p.write_field_end();
        p.write_field_begin("medium", ::fbthrift::TType::I16, 3);
        ::fbthrift::Serialize::write(&self.medium, p);
        p.write_field_end();
        p.write_field_begin("biggish", ::fbthrift::TType::I32, 4);
        ::fbthrift::Serialize::write(&self.biggish, p);
        p.write_field_end();
        p.write_field_begin("tiny", ::fbthrift::TType::Byte, 5);
        ::fbthrift::Serialize::write(&self.tiny, p);
        p.write_field_end();
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::MinPadding
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
            ::fbthrift::Field::new("big", ::fbthrift::TType::I64, 2),
            ::fbthrift::Field::new("biggish", ::fbthrift::TType::I32, 4),
            ::fbthrift::Field::new("medium", ::fbthrift::TType::I16, 3),
            ::fbthrift::Field::new("small", ::fbthrift::TType::Byte, 1),
            ::fbthrift::Field::new("tiny", ::fbthrift::TType::Byte, 5),
        ];
        let mut field_small = ::std::option::Option::None;
        let mut field_big = ::std::option::Option::None;
        let mut field_medium = ::std::option::Option::None;
        let mut field_biggish = ::std::option::Option::None;
        let mut field_tiny = ::std::option::Option::None;
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (::fbthrift::TType::Byte, 1) => field_small = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::I64, 2) => field_big = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::I16, 3) => field_medium = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::I32, 4) => field_biggish = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::Byte, 5) => field_tiny = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            small: field_small.unwrap_or_default(),
            big: field_big.unwrap_or_default(),
            medium: field_medium.unwrap_or_default(),
            biggish: field_biggish.unwrap_or_default(),
            tiny: field_tiny.unwrap_or_default(),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for MinPadding {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        if type_id == ::std::any::TypeId::of::<cpp::types::MinimizePadding>() {
            let mut tmp = Some(cpp::types::MinimizePadding {
                ..::std::default::Default::default()
            });
            let r: &mut dyn ::std::any::Any = &mut tmp;
            let r: &mut Option<T> = r.downcast_mut().unwrap();
            return r.take();
        }

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            1 => {
            },
            2 => {
            },
            3 => {
            },
            4 => {
            },
            5 => {
            },
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::MinPaddingWithCustomType {
    fn default() -> Self {
        Self {
            small: ::std::default::Default::default(),
            big: ::std::default::Default::default(),
            medium: ::std::default::Default::default(),
            biggish: ::std::default::Default::default(),
            tiny: ::std::default::Default::default(),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::MinPaddingWithCustomType {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("MinPaddingWithCustomType")
            .field("small", &self.small)
            .field("big", &self.big)
            .field("medium", &self.medium)
            .field("biggish", &self.biggish)
            .field("tiny", &self.tiny)
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::MinPaddingWithCustomType {}
unsafe impl ::std::marker::Sync for self::MinPaddingWithCustomType {}
impl ::std::marker::Unpin for self::MinPaddingWithCustomType {}

impl ::fbthrift::GetTType for self::MinPaddingWithCustomType {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::MinPaddingWithCustomType {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/MinPaddingWithCustomType"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::MinPaddingWithCustomType
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("MinPaddingWithCustomType");
        p.write_field_begin("small", ::fbthrift::TType::Byte, 1);
        ::fbthrift::Serialize::write(&self.small, p);
        p.write_field_end();
        p.write_field_begin("big", ::fbthrift::TType::I64, 2);
        ::fbthrift::Serialize::write(&self.big, p);
        p.write_field_end();
        p.write_field_begin("medium", ::fbthrift::TType::I16, 3);
        ::fbthrift::Serialize::write(&self.medium, p);
        p.write_field_end();
        p.write_field_begin("biggish", ::fbthrift::TType::I32, 4);
        ::fbthrift::Serialize::write(&self.biggish, p);
        p.write_field_end();
        p.write_field_begin("tiny", ::fbthrift::TType::Byte, 5);
        ::fbthrift::Serialize::write(&self.tiny, p);
        p.write_field_end();
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::MinPaddingWithCustomType
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
            ::fbthrift::Field::new("big", ::fbthrift::TType::I64, 2),
            ::fbthrift::Field::new("biggish", ::fbthrift::TType::I32, 4),
            ::fbthrift::Field::new("medium", ::fbthrift::TType::I16, 3),
            ::fbthrift::Field::new("small", ::fbthrift::TType::Byte, 1),
            ::fbthrift::Field::new("tiny", ::fbthrift::TType::Byte, 5),
        ];
        let mut field_small = ::std::option::Option::None;
        let mut field_big = ::std::option::Option::None;
        let mut field_medium = ::std::option::Option::None;
        let mut field_biggish = ::std::option::Option::None;
        let mut field_tiny = ::std::option::Option::None;
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (::fbthrift::TType::Byte, 1) => field_small = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::I64, 2) => field_big = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::I16, 3) => field_medium = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::I32, 4) => field_biggish = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::Byte, 5) => field_tiny = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            small: field_small.unwrap_or_default(),
            big: field_big.unwrap_or_default(),
            medium: field_medium.unwrap_or_default(),
            biggish: field_biggish.unwrap_or_default(),
            tiny: field_tiny.unwrap_or_default(),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for MinPaddingWithCustomType {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        if type_id == ::std::any::TypeId::of::<thrift::types::Experimental>() {
            let mut tmp = Some(thrift::types::Experimental {
                ..::std::default::Default::default()
            });
            let r: &mut dyn ::std::any::Any = &mut tmp;
            let r: &mut Option<T> = r.downcast_mut().unwrap();
            return r.take();
        }

        if let Some(r) = <thrift::types::Experimental as ::fbthrift::metadata::ThriftAnnotations>::get_structured_annotation::<T>() {
            return Some(r);
        }

        if type_id == ::std::any::TypeId::of::<cpp::types::MinimizePadding>() {
            let mut tmp = Some(cpp::types::MinimizePadding {
                ..::std::default::Default::default()
            });
            let r: &mut dyn ::std::any::Any = &mut tmp;
            let r: &mut Option<T> = r.downcast_mut().unwrap();
            return r.take();
        }

        if type_id == ::std::any::TypeId::of::<thrift::types::TerseWrite>() {
            let mut tmp = Some(thrift::types::TerseWrite {
                ..::std::default::Default::default()
            });
            let r: &mut dyn ::std::any::Any = &mut tmp;
            let r: &mut Option<T> = r.downcast_mut().unwrap();
            return r.take();
        }

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            1 => {
            },
            2 => {
            },
            3 => {

                if type_id == ::std::any::TypeId::of::<cpp::types::Adapter>() {
                    let mut tmp = Some(cpp::types::Adapter {
                        name: "::my::Adapter".to_owned(),
                        adaptedType: ::std::default::Default::default(),
                        underlyingName: ::std::default::Default::default(),
                        extraNamespace: ::std::default::Default::default(),
                        moveOnly: ::std::default::Default::default(),
                        ..::std::default::Default::default()
                    });
                    let r: &mut dyn ::std::any::Any = &mut tmp;
                    let r: &mut Option<T> = r.downcast_mut().unwrap();
                    return r.take();
                }

                if let Some(r) = <cpp::types::Adapter as ::fbthrift::metadata::ThriftAnnotations>::get_structured_annotation::<T>() {
                    return Some(r);
                }
            },
            4 => {
            },
            5 => {
            },
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::MyStruct {
    fn default() -> Self {
        Self {
            MyIntField: ::std::default::Default::default(),
            MyStringField: ::std::default::Default::default(),
            majorVer: ::std::default::Default::default(),
            data: ::std::default::Default::default(),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::MyStruct {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("MyStruct")
            .field("MyIntField", &self.MyIntField)
            .field("MyStringField", &self.MyStringField)
            .field("majorVer", &self.majorVer)
            .field("data", &self.data)
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::MyStruct {}
unsafe impl ::std::marker::Sync for self::MyStruct {}
impl ::std::marker::Unpin for self::MyStruct {}

impl ::fbthrift::GetTType for self::MyStruct {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::MyStruct {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/MyStruct"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::MyStruct
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("MyStruct");
        p.write_field_begin("MyIntField", ::fbthrift::TType::I64, 1);
        ::fbthrift::Serialize::write(&self.MyIntField, p);
        p.write_field_end();
        p.write_field_begin("MyStringField", ::fbthrift::TType::String, 2);
        ::fbthrift::Serialize::write(&self.MyStringField, p);
        p.write_field_end();
        p.write_field_begin("majorVer", ::fbthrift::TType::I64, 3);
        ::fbthrift::Serialize::write(&self.majorVer, p);
        p.write_field_end();
        p.write_field_begin("data", ::fbthrift::TType::Struct, 4);
        ::fbthrift::Serialize::write(&self.data, p);
        p.write_field_end();
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::MyStruct
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
            ::fbthrift::Field::new("MyIntField", ::fbthrift::TType::I64, 1),
            ::fbthrift::Field::new("MyStringField", ::fbthrift::TType::String, 2),
            ::fbthrift::Field::new("data", ::fbthrift::TType::Struct, 4),
            ::fbthrift::Field::new("majorVer", ::fbthrift::TType::I64, 3),
        ];
        let mut field_MyIntField = ::std::option::Option::None;
        let mut field_MyStringField = ::std::option::Option::None;
        let mut field_majorVer = ::std::option::Option::None;
        let mut field_data = ::std::option::Option::None;
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (::fbthrift::TType::I64, 1) => field_MyIntField = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::String, 2) => field_MyStringField = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::I64, 3) => field_majorVer = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::Struct, 4) => field_data = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            MyIntField: field_MyIntField.unwrap_or_default(),
            MyStringField: field_MyStringField.unwrap_or_default(),
            majorVer: field_majorVer.unwrap_or_default(),
            data: field_data.unwrap_or_default(),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for MyStruct {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            1 => {
            },
            2 => {
            },
            3 => {
            },
            4 => {
            },
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::MyDataItem {
    fn default() -> Self {
        Self {
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::MyDataItem {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("MyDataItem")
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::MyDataItem {}
unsafe impl ::std::marker::Sync for self::MyDataItem {}
impl ::std::marker::Unpin for self::MyDataItem {}

impl ::fbthrift::GetTType for self::MyDataItem {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::MyDataItem {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/MyDataItem"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::MyDataItem
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("MyDataItem");
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::MyDataItem
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
        ];
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for MyDataItem {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::Renaming {
    fn default() -> Self {
        Self {
            foo: ::std::default::Default::default(),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::Renaming {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("Renaming")
            .field("foo", &self.foo)
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::Renaming {}
unsafe impl ::std::marker::Sync for self::Renaming {}
impl ::std::marker::Unpin for self::Renaming {}

impl ::fbthrift::GetTType for self::Renaming {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::Renaming {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/Renaming"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::Renaming
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("Renaming");
        p.write_field_begin("foo", ::fbthrift::TType::I64, 1);
        ::fbthrift::Serialize::write(&self.foo, p);
        p.write_field_end();
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::Renaming
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
            ::fbthrift::Field::new("foo", ::fbthrift::TType::I64, 1),
        ];
        let mut field_foo = ::std::option::Option::None;
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (::fbthrift::TType::I64, 1) => field_foo = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            foo: field_foo.unwrap_or_default(),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for Renaming {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            1 => {
            },
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::AnnotatedTypes {
    fn default() -> Self {
        Self {
            binary_field: ::std::default::Default::default(),
            list_field: ::std::default::Default::default(),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::AnnotatedTypes {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("AnnotatedTypes")
            .field("binary_field", &self.binary_field)
            .field("list_field", &self.list_field)
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::AnnotatedTypes {}
unsafe impl ::std::marker::Sync for self::AnnotatedTypes {}
impl ::std::marker::Unpin for self::AnnotatedTypes {}

impl ::fbthrift::GetTType for self::AnnotatedTypes {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::AnnotatedTypes {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/AnnotatedTypes"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::AnnotatedTypes
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("AnnotatedTypes");
        p.write_field_begin("binary_field", ::fbthrift::TType::String, 1);
        ::fbthrift::Serialize::write(&self.binary_field, p);
        p.write_field_end();
        p.write_field_begin("list_field", ::fbthrift::TType::List, 2);
        ::fbthrift::Serialize::write(&self.list_field, p);
        p.write_field_end();
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::AnnotatedTypes
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
            ::fbthrift::Field::new("binary_field", ::fbthrift::TType::String, 1),
            ::fbthrift::Field::new("list_field", ::fbthrift::TType::List, 2),
        ];
        let mut field_binary_field = ::std::option::Option::None;
        let mut field_list_field = ::std::option::Option::None;
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (::fbthrift::TType::String, 1) => field_binary_field = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::List, 2) => field_list_field = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            binary_field: field_binary_field.unwrap_or_default(),
            list_field: field_list_field.unwrap_or_default(),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for AnnotatedTypes {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            1 => {
            },
            2 => {
            },
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::ForwardUsageRoot {
    fn default() -> Self {
        Self {
            ForwardUsageStruct: ::std::option::Option::None,
            ForwardUsageByRef: ::std::option::Option::None,
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::ForwardUsageRoot {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("ForwardUsageRoot")
            .field("ForwardUsageStruct", &self.ForwardUsageStruct)
            .field("ForwardUsageByRef", &self.ForwardUsageByRef)
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::ForwardUsageRoot {}
unsafe impl ::std::marker::Sync for self::ForwardUsageRoot {}
impl ::std::marker::Unpin for self::ForwardUsageRoot {}

impl ::fbthrift::GetTType for self::ForwardUsageRoot {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::ForwardUsageRoot {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/ForwardUsageRoot"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::ForwardUsageRoot
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("ForwardUsageRoot");
        if let ::std::option::Option::Some(some) = &self.ForwardUsageStruct {
            p.write_field_begin("ForwardUsageStruct", ::fbthrift::TType::Struct, 1);
            ::fbthrift::Serialize::write(some, p);
            p.write_field_end();
        }
        if let ::std::option::Option::Some(some) = &self.ForwardUsageByRef {
            p.write_field_begin("ForwardUsageByRef", ::fbthrift::TType::Struct, 2);
            ::fbthrift::Serialize::write(some, p);
            p.write_field_end();
        }
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::ForwardUsageRoot
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
            ::fbthrift::Field::new("ForwardUsageByRef", ::fbthrift::TType::Struct, 2),
            ::fbthrift::Field::new("ForwardUsageStruct", ::fbthrift::TType::Struct, 1),
        ];
        let mut field_ForwardUsageStruct = ::std::option::Option::None;
        let mut field_ForwardUsageByRef = ::std::option::Option::None;
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (::fbthrift::TType::Struct, 1) => field_ForwardUsageStruct = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::Struct, 2) => field_ForwardUsageByRef = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            ForwardUsageStruct: field_ForwardUsageStruct,
            ForwardUsageByRef: field_ForwardUsageByRef,
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for ForwardUsageRoot {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            1 => {
            },
            2 => {
            },
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::ForwardUsageStruct {
    fn default() -> Self {
        Self {
            foo: ::std::option::Option::None,
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::ForwardUsageStruct {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("ForwardUsageStruct")
            .field("foo", &self.foo)
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::ForwardUsageStruct {}
unsafe impl ::std::marker::Sync for self::ForwardUsageStruct {}
impl ::std::marker::Unpin for self::ForwardUsageStruct {}

impl ::fbthrift::GetTType for self::ForwardUsageStruct {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::ForwardUsageStruct {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/ForwardUsageStruct"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::ForwardUsageStruct
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("ForwardUsageStruct");
        if let ::std::option::Option::Some(some) = &self.foo {
            p.write_field_begin("foo", ::fbthrift::TType::Struct, 1);
            ::fbthrift::Serialize::write(some, p);
            p.write_field_end();
        }
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::ForwardUsageStruct
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
            ::fbthrift::Field::new("foo", ::fbthrift::TType::Struct, 1),
        ];
        let mut field_foo = ::std::option::Option::None;
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (::fbthrift::TType::Struct, 1) => field_foo = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            foo: field_foo,
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for ForwardUsageStruct {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            1 => {
            },
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::ForwardUsageByRef {
    fn default() -> Self {
        Self {
            foo: ::std::option::Option::None,
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::ForwardUsageByRef {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("ForwardUsageByRef")
            .field("foo", &self.foo)
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::ForwardUsageByRef {}
unsafe impl ::std::marker::Sync for self::ForwardUsageByRef {}
impl ::std::marker::Unpin for self::ForwardUsageByRef {}

impl ::fbthrift::GetTType for self::ForwardUsageByRef {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::ForwardUsageByRef {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/ForwardUsageByRef"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::ForwardUsageByRef
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("ForwardUsageByRef");
        if let ::std::option::Option::Some(some) = &self.foo {
            p.write_field_begin("foo", ::fbthrift::TType::Struct, 1);
            ::fbthrift::Serialize::write(some, p);
            p.write_field_end();
        }
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::ForwardUsageByRef
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
            ::fbthrift::Field::new("foo", ::fbthrift::TType::Struct, 1),
        ];
        let mut field_foo = ::std::option::Option::None;
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (::fbthrift::TType::Struct, 1) => field_foo = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            foo: field_foo,
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for ForwardUsageByRef {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            1 => {
            },
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::IncompleteMap {
    fn default() -> Self {
        Self {
            field: ::std::option::Option::None,
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::IncompleteMap {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("IncompleteMap")
            .field("field", &self.field)
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::IncompleteMap {}
unsafe impl ::std::marker::Sync for self::IncompleteMap {}
impl ::std::marker::Unpin for self::IncompleteMap {}

impl ::fbthrift::GetTType for self::IncompleteMap {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::IncompleteMap {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/IncompleteMap"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::IncompleteMap
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("IncompleteMap");
        if let ::std::option::Option::Some(some) = &self.field {
            p.write_field_begin("field", ::fbthrift::TType::Map, 1);
            ::fbthrift::Serialize::write(some, p);
            p.write_field_end();
        }
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::IncompleteMap
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
            ::fbthrift::Field::new("field", ::fbthrift::TType::Map, 1),
        ];
        let mut field_field = ::std::option::Option::None;
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (::fbthrift::TType::Map, 1) => field_field = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            field: field_field,
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for IncompleteMap {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            1 => {
            },
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::IncompleteMapDep {
    fn default() -> Self {
        Self {
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::IncompleteMapDep {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("IncompleteMapDep")
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::IncompleteMapDep {}
unsafe impl ::std::marker::Sync for self::IncompleteMapDep {}
impl ::std::marker::Unpin for self::IncompleteMapDep {}

impl ::fbthrift::GetTType for self::IncompleteMapDep {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::IncompleteMapDep {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/IncompleteMapDep"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::IncompleteMapDep
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("IncompleteMapDep");
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::IncompleteMapDep
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
        ];
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for IncompleteMapDep {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::CompleteMap {
    fn default() -> Self {
        Self {
            field: ::std::option::Option::None,
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::CompleteMap {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("CompleteMap")
            .field("field", &self.field)
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::CompleteMap {}
unsafe impl ::std::marker::Sync for self::CompleteMap {}
impl ::std::marker::Unpin for self::CompleteMap {}

impl ::fbthrift::GetTType for self::CompleteMap {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::CompleteMap {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/CompleteMap"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::CompleteMap
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("CompleteMap");
        if let ::std::option::Option::Some(some) = &self.field {
            p.write_field_begin("field", ::fbthrift::TType::Map, 1);
            ::fbthrift::Serialize::write(some, p);
            p.write_field_end();
        }
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::CompleteMap
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
            ::fbthrift::Field::new("field", ::fbthrift::TType::Map, 1),
        ];
        let mut field_field = ::std::option::Option::None;
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (::fbthrift::TType::Map, 1) => field_field = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            field: field_field,
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for CompleteMap {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            1 => {
            },
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::CompleteMapDep {
    fn default() -> Self {
        Self {
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::CompleteMapDep {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("CompleteMapDep")
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::CompleteMapDep {}
unsafe impl ::std::marker::Sync for self::CompleteMapDep {}
impl ::std::marker::Unpin for self::CompleteMapDep {}

impl ::fbthrift::GetTType for self::CompleteMapDep {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::CompleteMapDep {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/CompleteMapDep"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::CompleteMapDep
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("CompleteMapDep");
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::CompleteMapDep
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
        ];
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for CompleteMapDep {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::IncompleteList {
    fn default() -> Self {
        Self {
            field: ::std::option::Option::None,
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::IncompleteList {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("IncompleteList")
            .field("field", &self.field)
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::IncompleteList {}
unsafe impl ::std::marker::Sync for self::IncompleteList {}
impl ::std::marker::Unpin for self::IncompleteList {}

impl ::fbthrift::GetTType for self::IncompleteList {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::IncompleteList {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/IncompleteList"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::IncompleteList
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("IncompleteList");
        if let ::std::option::Option::Some(some) = &self.field {
            p.write_field_begin("field", ::fbthrift::TType::List, 1);
            ::fbthrift::Serialize::write(some, p);
            p.write_field_end();
        }
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::IncompleteList
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
            ::fbthrift::Field::new("field", ::fbthrift::TType::List, 1),
        ];
        let mut field_field = ::std::option::Option::None;
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (::fbthrift::TType::List, 1) => field_field = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            field: field_field,
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for IncompleteList {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            1 => {
            },
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::IncompleteListDep {
    fn default() -> Self {
        Self {
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::IncompleteListDep {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("IncompleteListDep")
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::IncompleteListDep {}
unsafe impl ::std::marker::Sync for self::IncompleteListDep {}
impl ::std::marker::Unpin for self::IncompleteListDep {}

impl ::fbthrift::GetTType for self::IncompleteListDep {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::IncompleteListDep {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/IncompleteListDep"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::IncompleteListDep
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("IncompleteListDep");
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::IncompleteListDep
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
        ];
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for IncompleteListDep {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::CompleteList {
    fn default() -> Self {
        Self {
            field: ::std::option::Option::None,
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::CompleteList {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("CompleteList")
            .field("field", &self.field)
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::CompleteList {}
unsafe impl ::std::marker::Sync for self::CompleteList {}
impl ::std::marker::Unpin for self::CompleteList {}

impl ::fbthrift::GetTType for self::CompleteList {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::CompleteList {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/CompleteList"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::CompleteList
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("CompleteList");
        if let ::std::option::Option::Some(some) = &self.field {
            p.write_field_begin("field", ::fbthrift::TType::List, 1);
            ::fbthrift::Serialize::write(some, p);
            p.write_field_end();
        }
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::CompleteList
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
            ::fbthrift::Field::new("field", ::fbthrift::TType::List, 1),
        ];
        let mut field_field = ::std::option::Option::None;
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (::fbthrift::TType::List, 1) => field_field = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            field: field_field,
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for CompleteList {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            1 => {
            },
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::CompleteListDep {
    fn default() -> Self {
        Self {
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::CompleteListDep {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("CompleteListDep")
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::CompleteListDep {}
unsafe impl ::std::marker::Sync for self::CompleteListDep {}
impl ::std::marker::Unpin for self::CompleteListDep {}

impl ::fbthrift::GetTType for self::CompleteListDep {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::CompleteListDep {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/CompleteListDep"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::CompleteListDep
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("CompleteListDep");
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::CompleteListDep
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
        ];
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for CompleteListDep {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::AdaptedList {
    fn default() -> Self {
        Self {
            field: ::std::option::Option::None,
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::AdaptedList {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("AdaptedList")
            .field("field", &self.field)
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::AdaptedList {}
unsafe impl ::std::marker::Sync for self::AdaptedList {}
impl ::std::marker::Unpin for self::AdaptedList {}

impl ::fbthrift::GetTType for self::AdaptedList {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::AdaptedList {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/AdaptedList"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::AdaptedList
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("AdaptedList");
        if let ::std::option::Option::Some(some) = &self.field {
            p.write_field_begin("field", ::fbthrift::TType::List, 1);
            ::fbthrift::Serialize::write(some, p);
            p.write_field_end();
        }
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::AdaptedList
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
            ::fbthrift::Field::new("field", ::fbthrift::TType::List, 1),
        ];
        let mut field_field = ::std::option::Option::None;
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (::fbthrift::TType::List, 1) => field_field = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            field: field_field,
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for AdaptedList {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            1 => {
            },
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::AdaptedListDep {
    fn default() -> Self {
        Self {
            field: ::std::default::Default::default(),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::AdaptedListDep {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("AdaptedListDep")
            .field("field", &self.field)
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::AdaptedListDep {}
unsafe impl ::std::marker::Sync for self::AdaptedListDep {}
impl ::std::marker::Unpin for self::AdaptedListDep {}

impl ::fbthrift::GetTType for self::AdaptedListDep {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::AdaptedListDep {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/AdaptedListDep"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::AdaptedListDep
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("AdaptedListDep");
        p.write_field_begin("field", ::fbthrift::TType::Struct, 1);
        ::fbthrift::Serialize::write(&self.field, p);
        p.write_field_end();
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::AdaptedListDep
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
            ::fbthrift::Field::new("field", ::fbthrift::TType::Struct, 1),
        ];
        let mut field_field = ::std::option::Option::None;
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (::fbthrift::TType::Struct, 1) => field_field = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            field: field_field.unwrap_or_default(),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for AdaptedListDep {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        if type_id == ::std::any::TypeId::of::<cpp::types::Adapter>() {
            let mut tmp = Some(cpp::types::Adapter {
                name: "IdentityAdapter<detail::AdaptedListDep>".to_owned(),
                adaptedType: "detail::AdaptedListDep".to_owned(),
                underlyingName: ::std::default::Default::default(),
                extraNamespace: ::std::default::Default::default(),
                moveOnly: ::std::default::Default::default(),
                ..::std::default::Default::default()
            });
            let r: &mut dyn ::std::any::Any = &mut tmp;
            let r: &mut Option<T> = r.downcast_mut().unwrap();
            return r.take();
        }

        if let Some(r) = <cpp::types::Adapter as ::fbthrift::metadata::ThriftAnnotations>::get_structured_annotation::<T>() {
            return Some(r);
        }

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            1 => {
            },
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::DependentAdaptedList {
    fn default() -> Self {
        Self {
            field: ::std::option::Option::None,
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::DependentAdaptedList {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("DependentAdaptedList")
            .field("field", &self.field)
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::DependentAdaptedList {}
unsafe impl ::std::marker::Sync for self::DependentAdaptedList {}
impl ::std::marker::Unpin for self::DependentAdaptedList {}

impl ::fbthrift::GetTType for self::DependentAdaptedList {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::DependentAdaptedList {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/DependentAdaptedList"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::DependentAdaptedList
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("DependentAdaptedList");
        if let ::std::option::Option::Some(some) = &self.field {
            p.write_field_begin("field", ::fbthrift::TType::List, 1);
            ::fbthrift::Serialize::write(some, p);
            p.write_field_end();
        }
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::DependentAdaptedList
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
            ::fbthrift::Field::new("field", ::fbthrift::TType::List, 1),
        ];
        let mut field_field = ::std::option::Option::None;
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (::fbthrift::TType::List, 1) => field_field = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            field: field_field,
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for DependentAdaptedList {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            1 => {
            },
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::DependentAdaptedListDep {
    fn default() -> Self {
        Self {
            field: ::std::option::Option::None,
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::DependentAdaptedListDep {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("DependentAdaptedListDep")
            .field("field", &self.field)
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::DependentAdaptedListDep {}
unsafe impl ::std::marker::Sync for self::DependentAdaptedListDep {}
impl ::std::marker::Unpin for self::DependentAdaptedListDep {}

impl ::fbthrift::GetTType for self::DependentAdaptedListDep {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::DependentAdaptedListDep {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/DependentAdaptedListDep"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::DependentAdaptedListDep
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("DependentAdaptedListDep");
        if let ::std::option::Option::Some(some) = &self.field {
            p.write_field_begin("field", ::fbthrift::TType::I16, 1);
            ::fbthrift::Serialize::write(some, p);
            p.write_field_end();
        }
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::DependentAdaptedListDep
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
            ::fbthrift::Field::new("field", ::fbthrift::TType::I16, 1),
        ];
        let mut field_field = ::std::option::Option::None;
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (::fbthrift::TType::I16, 1) => field_field = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            field: field_field,
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for DependentAdaptedListDep {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        if type_id == ::std::any::TypeId::of::<cpp::types::Adapter>() {
            let mut tmp = Some(cpp::types::Adapter {
                name: "IdentityAdapter<detail::DependentAdaptedListDep>".to_owned(),
                adaptedType: ::std::default::Default::default(),
                underlyingName: ::std::default::Default::default(),
                extraNamespace: ::std::default::Default::default(),
                moveOnly: ::std::default::Default::default(),
                ..::std::default::Default::default()
            });
            let r: &mut dyn ::std::any::Any = &mut tmp;
            let r: &mut Option<T> = r.downcast_mut().unwrap();
            return r.take();
        }

        if let Some(r) = <cpp::types::Adapter as ::fbthrift::metadata::ThriftAnnotations>::get_structured_annotation::<T>() {
            return Some(r);
        }

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            1 => {

                if type_id == ::std::any::TypeId::of::<thrift::types::Box>() {
                    let mut tmp = Some(thrift::types::Box {
                        ..::std::default::Default::default()
                    });
                    let r: &mut dyn ::std::any::Any = &mut tmp;
                    let r: &mut Option<T> = r.downcast_mut().unwrap();
                    return r.take();
                }
            },
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::AllocatorAware {
    fn default() -> Self {
        Self {
            aa_list: ::std::default::Default::default(),
            aa_set: ::std::default::Default::default(),
            aa_map: ::std::default::Default::default(),
            aa_string: ::std::default::Default::default(),
            not_a_container: ::std::default::Default::default(),
            aa_unique: ::std::default::Default::default(),
            aa_shared: ::std::default::Default::default(),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::AllocatorAware {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("AllocatorAware")
            .field("aa_list", &self.aa_list)
            .field("aa_set", &self.aa_set)
            .field("aa_map", &self.aa_map)
            .field("aa_string", &self.aa_string)
            .field("not_a_container", &self.not_a_container)
            .field("aa_unique", &self.aa_unique)
            .field("aa_shared", &self.aa_shared)
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::AllocatorAware {}
unsafe impl ::std::marker::Sync for self::AllocatorAware {}
impl ::std::marker::Unpin for self::AllocatorAware {}

impl ::fbthrift::GetTType for self::AllocatorAware {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::AllocatorAware {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/AllocatorAware"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::AllocatorAware
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("AllocatorAware");
        p.write_field_begin("aa_list", ::fbthrift::TType::List, 1);
        ::fbthrift::Serialize::write(&self.aa_list, p);
        p.write_field_end();
        p.write_field_begin("aa_set", ::fbthrift::TType::Set, 2);
        ::fbthrift::Serialize::write(&self.aa_set, p);
        p.write_field_end();
        p.write_field_begin("aa_map", ::fbthrift::TType::Map, 3);
        ::fbthrift::Serialize::write(&self.aa_map, p);
        p.write_field_end();
        p.write_field_begin("aa_string", ::fbthrift::TType::String, 4);
        ::fbthrift::Serialize::write(&self.aa_string, p);
        p.write_field_end();
        p.write_field_begin("not_a_container", ::fbthrift::TType::I32, 5);
        ::fbthrift::Serialize::write(&self.not_a_container, p);
        p.write_field_end();
        p.write_field_begin("aa_unique", ::fbthrift::TType::I32, 6);
        ::fbthrift::Serialize::write(&self.aa_unique, p);
        p.write_field_end();
        p.write_field_begin("aa_shared", ::fbthrift::TType::I32, 7);
        ::fbthrift::Serialize::write(&self.aa_shared, p);
        p.write_field_end();
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::AllocatorAware
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
            ::fbthrift::Field::new("aa_list", ::fbthrift::TType::List, 1),
            ::fbthrift::Field::new("aa_map", ::fbthrift::TType::Map, 3),
            ::fbthrift::Field::new("aa_set", ::fbthrift::TType::Set, 2),
            ::fbthrift::Field::new("aa_shared", ::fbthrift::TType::I32, 7),
            ::fbthrift::Field::new("aa_string", ::fbthrift::TType::String, 4),
            ::fbthrift::Field::new("aa_unique", ::fbthrift::TType::I32, 6),
            ::fbthrift::Field::new("not_a_container", ::fbthrift::TType::I32, 5),
        ];
        let mut field_aa_list = ::std::option::Option::None;
        let mut field_aa_set = ::std::option::Option::None;
        let mut field_aa_map = ::std::option::Option::None;
        let mut field_aa_string = ::std::option::Option::None;
        let mut field_not_a_container = ::std::option::Option::None;
        let mut field_aa_unique = ::std::option::Option::None;
        let mut field_aa_shared = ::std::option::Option::None;
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (::fbthrift::TType::List, 1) => field_aa_list = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::Set, 2) => field_aa_set = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::Map, 3) => field_aa_map = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::String, 4) => field_aa_string = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::I32, 5) => field_not_a_container = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::I32, 6) => field_aa_unique = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::I32, 7) => field_aa_shared = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            aa_list: field_aa_list.unwrap_or_default(),
            aa_set: field_aa_set.unwrap_or_default(),
            aa_map: field_aa_map.unwrap_or_default(),
            aa_string: field_aa_string.unwrap_or_default(),
            not_a_container: field_not_a_container.unwrap_or_default(),
            aa_unique: field_aa_unique.unwrap_or_default(),
            aa_shared: field_aa_shared.unwrap_or_default(),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for AllocatorAware {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            1 => {
            },
            2 => {
            },
            3 => {
            },
            4 => {
            },
            5 => {
            },
            6 => {

                if type_id == ::std::any::TypeId::of::<cpp::types::Ref>() {
                    let mut tmp = Some(cpp::types::Ref {
                        r#type: cpp::types::RefType(0),
                        ..::std::default::Default::default()
                    });
                    let r: &mut dyn ::std::any::Any = &mut tmp;
                    let r: &mut Option<T> = r.downcast_mut().unwrap();
                    return r.take();
                }
            },
            7 => {

                if type_id == ::std::any::TypeId::of::<cpp::types::Ref>() {
                    let mut tmp = Some(cpp::types::Ref {
                        r#type: cpp::types::RefType(2),
                        ..::std::default::Default::default()
                    });
                    let r: &mut dyn ::std::any::Any = &mut tmp;
                    let r: &mut Option<T> = r.downcast_mut().unwrap();
                    return r.take();
                }
            },
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::AllocatorAware2 {
    fn default() -> Self {
        Self {
            not_a_container: ::std::default::Default::default(),
            box_field: ::std::option::Option::None,
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::AllocatorAware2 {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("AllocatorAware2")
            .field("not_a_container", &self.not_a_container)
            .field("box_field", &self.box_field)
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::AllocatorAware2 {}
unsafe impl ::std::marker::Sync for self::AllocatorAware2 {}
impl ::std::marker::Unpin for self::AllocatorAware2 {}

impl ::fbthrift::GetTType for self::AllocatorAware2 {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::AllocatorAware2 {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/AllocatorAware2"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::AllocatorAware2
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("AllocatorAware2");
        p.write_field_begin("not_a_container", ::fbthrift::TType::I32, 1);
        ::fbthrift::Serialize::write(&self.not_a_container, p);
        p.write_field_end();
        if let ::std::option::Option::Some(some) = &self.box_field {
            p.write_field_begin("box_field", ::fbthrift::TType::I32, 2);
            ::fbthrift::Serialize::write(some, p);
            p.write_field_end();
        }
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::AllocatorAware2
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
            ::fbthrift::Field::new("box_field", ::fbthrift::TType::I32, 2),
            ::fbthrift::Field::new("not_a_container", ::fbthrift::TType::I32, 1),
        ];
        let mut field_not_a_container = ::std::option::Option::None;
        let mut field_box_field = ::std::option::Option::None;
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (::fbthrift::TType::I32, 1) => field_not_a_container = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::I32, 2) => field_box_field = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            not_a_container: field_not_a_container.unwrap_or_default(),
            box_field: field_box_field,
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for AllocatorAware2 {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            1 => {
            },
            2 => {

                if type_id == ::std::any::TypeId::of::<thrift::types::Box>() {
                    let mut tmp = Some(thrift::types::Box {
                        ..::std::default::Default::default()
                    });
                    let r: &mut dyn ::std::any::Any = &mut tmp;
                    let r: &mut Option<T> = r.downcast_mut().unwrap();
                    return r.take();
                }
            },
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::TypedefStruct {
    fn default() -> Self {
        Self {
            i32_field: ::std::default::Default::default(),
            IntTypedef_field: ::std::default::Default::default(),
            UintTypedef_field: ::std::default::Default::default(),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::TypedefStruct {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("TypedefStruct")
            .field("i32_field", &self.i32_field)
            .field("IntTypedef_field", &self.IntTypedef_field)
            .field("UintTypedef_field", &self.UintTypedef_field)
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::TypedefStruct {}
unsafe impl ::std::marker::Sync for self::TypedefStruct {}
impl ::std::marker::Unpin for self::TypedefStruct {}

impl ::fbthrift::GetTType for self::TypedefStruct {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::TypedefStruct {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/TypedefStruct"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::TypedefStruct
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("TypedefStruct");
        p.write_field_begin("i32_field", ::fbthrift::TType::I32, 1);
        ::fbthrift::Serialize::write(&self.i32_field, p);
        p.write_field_end();
        p.write_field_begin("IntTypedef_field", ::fbthrift::TType::I32, 2);
        ::fbthrift::Serialize::write(&self.IntTypedef_field, p);
        p.write_field_end();
        p.write_field_begin("UintTypedef_field", ::fbthrift::TType::I32, 3);
        ::fbthrift::Serialize::write(&self.UintTypedef_field, p);
        p.write_field_end();
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::TypedefStruct
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
            ::fbthrift::Field::new("IntTypedef_field", ::fbthrift::TType::I32, 2),
            ::fbthrift::Field::new("UintTypedef_field", ::fbthrift::TType::I32, 3),
            ::fbthrift::Field::new("i32_field", ::fbthrift::TType::I32, 1),
        ];
        let mut field_i32_field = ::std::option::Option::None;
        let mut field_IntTypedef_field = ::std::option::Option::None;
        let mut field_UintTypedef_field = ::std::option::Option::None;
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (::fbthrift::TType::I32, 1) => field_i32_field = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::I32, 2) => field_IntTypedef_field = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (::fbthrift::TType::I32, 3) => field_UintTypedef_field = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            i32_field: field_i32_field.unwrap_or_default(),
            IntTypedef_field: field_IntTypedef_field.unwrap_or_default(),
            UintTypedef_field: field_UintTypedef_field.unwrap_or_default(),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for TypedefStruct {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            1 => {
            },
            2 => {
            },
            3 => {
            },
            _ => {}
        }

        None
    }
}

#[allow(clippy::derivable_impls)]
impl ::std::default::Default for self::StructWithDoubleUnderscores {
    fn default() -> Self {
        Self {
            __field: ::std::default::Default::default(),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        }
    }
}

impl ::std::fmt::Debug for self::StructWithDoubleUnderscores {
    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        formatter
            .debug_struct("StructWithDoubleUnderscores")
            .field("__field", &self.__field)
            .finish()
    }
}

unsafe impl ::std::marker::Send for self::StructWithDoubleUnderscores {}
unsafe impl ::std::marker::Sync for self::StructWithDoubleUnderscores {}
impl ::std::marker::Unpin for self::StructWithDoubleUnderscores {}

impl ::fbthrift::GetTType for self::StructWithDoubleUnderscores {
    const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
}

impl ::fbthrift::GetUri for self::StructWithDoubleUnderscores {
    fn uri() -> &'static str {
        "apache.org/thrift/fixtures/types/StructWithDoubleUnderscores"
    }
}

impl<P> ::fbthrift::Serialize<P> for self::StructWithDoubleUnderscores
where
    P: ::fbthrift::ProtocolWriter,
{
    fn write(&self, p: &mut P) {
        p.write_struct_begin("StructWithDoubleUnderscores");
        p.write_field_begin("__field", ::fbthrift::TType::I32, 1);
        ::fbthrift::Serialize::write(&self.__field, p);
        p.write_field_end();
        p.write_field_stop();
        p.write_struct_end();
    }
}

impl<P> ::fbthrift::Deserialize<P> for self::StructWithDoubleUnderscores
where
    P: ::fbthrift::ProtocolReader,
{
    fn read(p: &mut P) -> ::anyhow::Result<Self> {
        static FIELDS: &[::fbthrift::Field] = &[
            ::fbthrift::Field::new("__field", ::fbthrift::TType::I32, 1),
        ];
        let mut field___field = ::std::option::Option::None;
        let _ = p.read_struct_begin(|_| ())?;
        loop {
            let (_, fty, fid) = p.read_field_begin(|_| (), FIELDS)?;
            match (fty, fid as ::std::primitive::i32) {
                (::fbthrift::TType::Stop, _) => break,
                (::fbthrift::TType::I32, 1) => field___field = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
                (fty, _) => p.skip(fty)?,
            }
            p.read_field_end()?;
        }
        p.read_struct_end()?;
        ::std::result::Result::Ok(Self {
            __field: field___field.unwrap_or_default(),
            _dot_dot_Default_default: self::dot_dot::OtherFields(()),
        })
    }
}

impl ::fbthrift::metadata::ThriftAnnotations for StructWithDoubleUnderscores {
    fn get_structured_annotation<T: Sized + 'static>() -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        None
    }

    fn get_field_structured_annotation<T: Sized + 'static>(field_id: i16) -> ::std::option::Option<T> {
        #[allow(unused_variables)]
        let type_id = ::std::any::TypeId::of::<T>();

        match field_id {
            1 => {
            },
            _ => {}
        }

        None
    }
}

mod dot_dot {
    #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
    pub struct OtherFields(pub(crate) ());

    #[allow(dead_code)] // if serde isn't being used
    pub(super) fn default_for_serde_deserialize() -> OtherFields {
        OtherFields(())
    }
}