Struct ibc_proto::google::protobuf::FieldOptions
source · pub struct FieldOptions {Show 13 fields
pub ctype: Option<i32>,
pub packed: Option<bool>,
pub jstype: Option<i32>,
pub lazy: Option<bool>,
pub unverified_lazy: Option<bool>,
pub deprecated: Option<bool>,
pub weak: Option<bool>,
pub debug_redact: Option<bool>,
pub retention: Option<i32>,
pub targets: Vec<i32>,
pub edition_defaults: Vec<EditionDefault>,
pub features: Option<FeatureSet>,
pub uninterpreted_option: Vec<UninterpretedOption>,
}
Fields§
§ctype: Option<i32>
The ctype option instructs the C++ code generator to use a different representation of the field than it normally would. See the specific options below. This option is only implemented to support use of [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of type “bytes” in the open source release – sorry, we’ll try to include other types in a future version!
packed: Option<bool>
The packed option can be enabled for repeated primitive fields to enable a more efficient representation on the wire. Rather than repeatedly writing the tag and type for each element, the entire array is encoded as a single length-delimited blob. In proto3, only explicit setting it to false will avoid using packed encoding.
jstype: Option<i32>
The jstype option determines the JavaScript type used for values of the field. The option is permitted only for 64 bit integral and fixed types (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING is represented as JavaScript string, which avoids loss of precision that can happen when a large value is converted to a floating point JavaScript. Specifying JS_NUMBER for the jstype causes the generated JavaScript code to use the JavaScript “number” type. The behavior of the default option JS_NORMAL is implementation dependent.
This option is an enum to permit additional types to be added, e.g. goog.math.Integer.
lazy: Option<bool>
Should this field be parsed lazily? Lazy applies only to message-type fields. It means that when the outer message is initially parsed, the inner message’s contents will not be parsed but instead stored in encoded form. The inner message will actually be parsed when it is first accessed.
This is only a hint. Implementations are free to choose whether to use eager or lazy parsing regardless of the value of this option. However, setting this option true suggests that the protocol author believes that using lazy parsing on this field is worth the additional bookkeeping overhead typically needed to implement it.
This option does not affect the public interface of any generated code; all method signatures remain the same. Furthermore, thread-safety of the interface is not affected by this option; const methods remain safe to call from multiple threads concurrently, while non-const methods continue to require exclusive access.
Note that implementations may choose not to check required fields within a lazy sub-message. That is, calling IsInitialized() on the outer message may return true even if the inner message has missing required fields. This is necessary because otherwise the inner message would have to be parsed in order to perform the check, defeating the purpose of lazy parsing. An implementation which chooses not to check required fields must be consistent about it. That is, for any particular sub-message, the implementation must either always check its required fields, or never check its required fields, regardless of whether or not the message has been parsed.
As of May 2022, lazy verifies the contents of the byte stream during parsing. An invalid byte stream will cause the overall parsing to fail.
unverified_lazy: Option<bool>
unverified_lazy does no correctness checks on the byte stream. This should only be used where lazy with verification is prohibitive for performance reasons.
deprecated: Option<bool>
Is this field deprecated? Depending on the target platform, this can emit Deprecated annotations for accessors, or it will be completely ignored; in the very least, this is a formalization for deprecating fields.
weak: Option<bool>
For Google-internal migration only. Do not use.
debug_redact: Option<bool>
Indicate that the field value should not be printed out when using debug formats, e.g. when the field contains sensitive credentials.
retention: Option<i32>
§targets: Vec<i32>
§edition_defaults: Vec<EditionDefault>
§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 FieldOptions
impl FieldOptions
sourcepub fn ctype(&self) -> CType
pub fn ctype(&self) -> CType
Returns the enum value of ctype
, or the default if the field is unset or set to an invalid enum value.
sourcepub fn packed(&self) -> bool
pub fn packed(&self) -> bool
Returns the value of packed
, or the default value if packed
is unset.
sourcepub fn deprecated(&self) -> bool
pub fn deprecated(&self) -> bool
Returns the value of deprecated
, or the default value if deprecated
is unset.
sourcepub fn jstype(&self) -> JsType
pub fn jstype(&self) -> JsType
Returns the enum value of jstype
, or the default if the field is unset or set to an invalid enum value.
sourcepub fn set_jstype(&mut self, value: JsType)
pub fn set_jstype(&mut self, value: JsType)
Sets jstype
to the provided enum value.
sourcepub fn unverified_lazy(&self) -> bool
pub fn unverified_lazy(&self) -> bool
Returns the value of unverified_lazy
, or the default value if unverified_lazy
is unset.
sourcepub fn debug_redact(&self) -> bool
pub fn debug_redact(&self) -> bool
Returns the value of debug_redact
, or the default value if debug_redact
is unset.
sourcepub fn retention(&self) -> OptionRetention
pub fn retention(&self) -> OptionRetention
Returns the enum value of retention
, or the default if the field is unset or set to an invalid enum value.
sourcepub fn set_retention(&mut self, value: OptionRetention)
pub fn set_retention(&mut self, value: OptionRetention)
Sets retention
to the provided enum value.
sourcepub fn targets(
&self
) -> FilterMap<Cloned<Iter<'_, i32>>, fn(_: i32) -> Option<OptionTargetType>>
pub fn targets( &self ) -> FilterMap<Cloned<Iter<'_, i32>>, fn(_: i32) -> Option<OptionTargetType>>
Returns an iterator which yields the valid enum values contained in targets
.
sourcepub fn push_targets(&mut self, value: OptionTargetType)
pub fn push_targets(&mut self, value: OptionTargetType)
Appends the provided enum value to targets
.
Trait Implementations§
source§impl Clone for FieldOptions
impl Clone for FieldOptions
source§fn clone(&self) -> FieldOptions
fn clone(&self) -> FieldOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for FieldOptions
impl Debug for FieldOptions
source§impl Default for FieldOptions
impl Default for FieldOptions
source§impl Message for FieldOptions
impl Message for FieldOptions
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where B: BufMut, Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where Self: Sized,
source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where B: BufMut, Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where Self: Sized,
source§fn decode<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode<B>(buf: B) -> Result<Self, DecodeError>where B: Buf, Self: Default,
source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where B: Buf, Self: Default,
source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where B: Buf, Self: Sized,
self
. Read moresource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where B: Buf, Self: Sized,
self
.source§impl PartialEq for FieldOptions
impl PartialEq for FieldOptions
source§fn eq(&self, other: &FieldOptions) -> bool
fn eq(&self, other: &FieldOptions) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for FieldOptions
Auto Trait Implementations§
impl RefUnwindSafe for FieldOptions
impl Send for FieldOptions
impl Sync for FieldOptions
impl Unpin for FieldOptions
impl UnwindSafe for FieldOptions
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request