prost-build 0.14.3

Generate Prost annotated Rust types from Protocol Buffers files.
Documentation
// This file is @generated by prost-build.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Test {
    #[prost(string, tag = "1")]
    pub not_outdated: ::prost::alloc::string::String,
    #[deprecated]
    #[prost(string, tag = "2")]
    pub outdated: ::prost::alloc::string::String,
    #[prost(string, optional, tag = "3")]
    pub optional_not_outdated: ::core::option::Option<::prost::alloc::string::String>,
    #[deprecated]
    #[prost(string, optional, tag = "4")]
    pub optional_outdated: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(enumeration = "Test2", tag = "5")]
    pub enum_not_outdated: i32,
    #[deprecated]
    #[prost(enumeration = "Test2", tag = "6")]
    pub enum_outdated: i32,
    #[prost(enumeration = "Test2", optional, tag = "7")]
    pub optional_enum_not_outdated: ::core::option::Option<i32>,
    #[deprecated]
    #[prost(enumeration = "Test2", optional, tag = "8")]
    pub optional_enum_outdated: ::core::option::Option<i32>,
    #[prost(enumeration = "Test2", repeated, tag = "9")]
    pub repeated_enum_not_outdated: ::prost::alloc::vec::Vec<i32>,
    #[deprecated]
    #[prost(enumeration = "Test2", repeated, packed = "false", tag = "10")]
    pub repeated_enum_outdated: ::prost::alloc::vec::Vec<i32>,
    #[prost(oneof = "test::Test3", tags = "11, 12")]
    pub test3: ::core::option::Option<test::Test3>,
}
/// Nested message and enum types in `Test`.
pub mod test {
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Test3 {
        #[prost(string, tag = "11")]
        OneofNotOutdated(::prost::alloc::string::String),
        #[deprecated]
        #[prost(string, tag = "12")]
        OneofOutdated(::prost::alloc::string::String),
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Test2 {
    NotOutdated = 0,
    #[deprecated]
    Outdated = 1,
}
impl Test2 {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::NotOutdated => "not_outdated",
            #[allow(deprecated)]
            Self::Outdated => "outdated",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "not_outdated" => Some(Self::NotOutdated),
            "outdated" => Some(#[allow(deprecated)] Self::Outdated),
            _ => None,
        }
    }
}