#[non_exhaustive]pub struct EnumOptions {
pub allow_alias: bool,
pub deprecated: bool,
pub deprecated_legacy_json_field_conflicts: bool,
pub features: Option<FeatureSet>,
pub uninterpreted_option: Vec<UninterpretedOption>,
/* private fields */
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.allow_alias: boolSet this option to true to allow mapping different tag names to the same value.
deprecated: boolIs this enum deprecated? Depending on the target platform, this can emit Deprecated annotations for the enum, or it will be completely ignored; in the very least, this is a formalization for deprecating enums.
deprecated_legacy_json_field_conflicts: boolEnable the legacy handling of JSON field name conflicts. This lowercases
and strips underscored from the fields before comparison in proto3 only.
The new behavior takes json_name into account and applies to proto2 as
well.
TODO Remove this legacy behavior once downstream teams have
had time to migrate.
features: Option<FeatureSet>Any features defined in the specific edition.
uninterpreted_option: Vec<UninterpretedOption>The parser stores options it doesn’t recognize here. See above.
Implementations§
Source§impl EnumOptions
impl EnumOptions
pub fn new() -> Self
Sourcepub fn set_allow_alias<T: Into<bool>>(self, v: T) -> Self
pub fn set_allow_alias<T: Into<bool>>(self, v: T) -> Self
Sets the value of allow_alias.
Sourcepub fn set_deprecated<T: Into<bool>>(self, v: T) -> Self
pub fn set_deprecated<T: Into<bool>>(self, v: T) -> Self
Sets the value of deprecated.
Sourcepub fn set_deprecated_legacy_json_field_conflicts<T: Into<bool>>(
self,
v: T,
) -> Self
👎Deprecated
pub fn set_deprecated_legacy_json_field_conflicts<T: Into<bool>>( self, v: T, ) -> Self
Sets the value of deprecated_legacy_json_field_conflicts.
Sourcepub fn set_features<T>(self, v: T) -> Selfwhere
T: Into<FeatureSet>,
pub fn set_features<T>(self, v: T) -> Selfwhere
T: Into<FeatureSet>,
Sets the value of features.
Sourcepub fn set_or_clear_features<T>(self, v: Option<T>) -> Selfwhere
T: Into<FeatureSet>,
pub fn set_or_clear_features<T>(self, v: Option<T>) -> Selfwhere
T: Into<FeatureSet>,
Sets or clears the value of features.
Sourcepub fn set_uninterpreted_option<T, V>(self, v: T) -> Self
pub fn set_uninterpreted_option<T, V>(self, v: T) -> Self
Sets the value of uninterpreted_option.
Trait Implementations§
Source§impl Clone for EnumOptions
impl Clone for EnumOptions
Source§fn clone(&self) -> EnumOptions
fn clone(&self) -> EnumOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more