#[non_exhaustive]pub struct FeatureSet {
pub field_presence: FieldPresence,
pub enum_type: EnumType,
pub repeated_field_encoding: RepeatedFieldEncoding,
pub utf8_validation: Utf8Validation,
pub message_encoding: MessageEncoding,
pub json_format: JsonFormat,
/* private fields */
}Expand description
TODO Enums in C++ gencode (and potentially other languages) are not well scoped. This means that each of the feature enums below can clash with each other. The short names we’ve chosen maximize call-site readability, but leave us very open to this scenario. A future feature will be designed and implemented to handle this, hopefully before we ever hit a conflict here.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.field_presence: FieldPresence§enum_type: EnumType§repeated_field_encoding: RepeatedFieldEncoding§utf8_validation: Utf8Validation§message_encoding: MessageEncoding§json_format: JsonFormatImplementations§
Source§impl FeatureSet
impl FeatureSet
pub fn new() -> Self
Sourcepub fn set_field_presence<T: Into<FieldPresence>>(self, v: T) -> Self
pub fn set_field_presence<T: Into<FieldPresence>>(self, v: T) -> Self
Sets the value of field_presence.
§Example
ⓘ
use google_cloud_wkt::feature_set::FieldPresence;
let x0 = FeatureSet::new().set_field_presence(FieldPresence::Explicit);
let x1 = FeatureSet::new().set_field_presence(FieldPresence::Implicit);
let x2 = FeatureSet::new().set_field_presence(FieldPresence::LegacyRequired);Sourcepub fn set_enum_type<T: Into<EnumType>>(self, v: T) -> Self
pub fn set_enum_type<T: Into<EnumType>>(self, v: T) -> Self
Sourcepub fn set_repeated_field_encoding<T: Into<RepeatedFieldEncoding>>(
self,
v: T,
) -> Self
pub fn set_repeated_field_encoding<T: Into<RepeatedFieldEncoding>>( self, v: T, ) -> Self
Sets the value of repeated_field_encoding.
§Example
ⓘ
use google_cloud_wkt::feature_set::RepeatedFieldEncoding;
let x0 = FeatureSet::new().set_repeated_field_encoding(RepeatedFieldEncoding::Packed);
let x1 = FeatureSet::new().set_repeated_field_encoding(RepeatedFieldEncoding::Expanded);Sourcepub fn set_utf8_validation<T: Into<Utf8Validation>>(self, v: T) -> Self
pub fn set_utf8_validation<T: Into<Utf8Validation>>(self, v: T) -> Self
Sets the value of utf8_validation.
§Example
ⓘ
use google_cloud_wkt::feature_set::Utf8Validation;
let x0 = FeatureSet::new().set_utf8_validation(Utf8Validation::Verify);
let x1 = FeatureSet::new().set_utf8_validation(Utf8Validation::None);Sourcepub fn set_message_encoding<T: Into<MessageEncoding>>(self, v: T) -> Self
pub fn set_message_encoding<T: Into<MessageEncoding>>(self, v: T) -> Self
Sets the value of message_encoding.
§Example
ⓘ
use google_cloud_wkt::feature_set::MessageEncoding;
let x0 = FeatureSet::new().set_message_encoding(MessageEncoding::LengthPrefixed);
let x1 = FeatureSet::new().set_message_encoding(MessageEncoding::Delimited);Sourcepub fn set_json_format<T: Into<JsonFormat>>(self, v: T) -> Self
pub fn set_json_format<T: Into<JsonFormat>>(self, v: T) -> Self
Sets the value of json_format.
§Example
ⓘ
use google_cloud_wkt::feature_set::JsonFormat;
let x0 = FeatureSet::new().set_json_format(JsonFormat::Allow);
let x1 = FeatureSet::new().set_json_format(JsonFormat::LegacyBestEffort);Trait Implementations§
Source§impl Clone for FeatureSet
impl Clone for FeatureSet
Source§fn clone(&self) -> FeatureSet
fn clone(&self) -> FeatureSet
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FeatureSet
impl Debug for FeatureSet
Source§impl Default for FeatureSet
impl Default for FeatureSet
Source§fn default() -> FeatureSet
fn default() -> FeatureSet
Returns the “default value” for a type. Read more
Source§impl PartialEq for FeatureSet
impl PartialEq for FeatureSet
impl StructuralPartialEq for FeatureSet
Auto Trait Implementations§
impl Freeze for FeatureSet
impl RefUnwindSafe for FeatureSet
impl Send for FeatureSet
impl Sync for FeatureSet
impl Unpin for FeatureSet
impl UnwindSafe for FeatureSet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more