FeatureSet

Struct FeatureSet 

Source
#[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: JsonFormat

Implementations§

Source§

impl FeatureSet

Source

pub fn new() -> Self

Source

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);
Source

pub fn set_enum_type<T: Into<EnumType>>(self, v: T) -> Self

Sets the value of enum_type.

§Example
use google_cloud_wkt::feature_set::EnumType;
let x0 = FeatureSet::new().set_enum_type(EnumType::Open);
let x1 = FeatureSet::new().set_enum_type(EnumType::Closed);
Source

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);
Source

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);
Source

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);
Source

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

Source§

fn clone(&self) -> FeatureSet

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FeatureSet

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FeatureSet

Source§

fn default() -> FeatureSet

Returns the “default value” for a type. Read more
Source§

impl Message for FeatureSet

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for FeatureSet

Source§

fn eq(&self, other: &FeatureSet) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for FeatureSet

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,