pub struct Declaration {
pub number: Option<i32>,
pub full_name: Option<String>,
pub type: Option<String>,
pub reserved: Option<bool>,
pub repeated: Option<bool>,
/* private fields */
}Fields§
§number: Option<i32>The extension number declared within the extension range.
Field 1: number
full_name: Option<String>The fully-qualified name of the extension field. There must be a leading dot in front of the full name.
Field 2: full_name
type: Option<String>The fully-qualified type name of the extension field. Unlike Metadata.type, Declaration.type must have a leading dot for messages and enums.
Field 3: type
reserved: Option<bool>If true, indicates that the number is reserved in the extension range, and any extension field with the number will fail to compile. Set this when a declared extension field is deleted.
Field 5: reserved
repeated: Option<bool>If true, indicates that the extension must be defined as repeated. Otherwise the extension must be defined as optional.
Field 6: repeated
Implementations§
Source§impl Declaration
impl Declaration
Source§impl Declaration
impl Declaration
Sourcepub fn with_number(self, value: i32) -> Self
pub fn with_number(self, value: i32) -> Self
Sets Self::number to Some(value), consuming and returning self.
Sourcepub fn with_full_name(self, value: impl Into<String>) -> Self
pub fn with_full_name(self, value: impl Into<String>) -> Self
Sets Self::full_name to Some(value), consuming and returning self.
Sourcepub fn with_type(self, value: impl Into<String>) -> Self
pub fn with_type(self, value: impl Into<String>) -> Self
Sets [Self::r#type] to Some(value), consuming and returning self.
Sourcepub fn with_reserved(self, value: bool) -> Self
pub fn with_reserved(self, value: bool) -> Self
Sets Self::reserved to Some(value), consuming and returning self.
Sourcepub fn with_repeated(self, value: bool) -> Self
pub fn with_repeated(self, value: bool) -> Self
Sets Self::repeated to Some(value), consuming and returning self.
Trait Implementations§
Source§impl Clone for Declaration
impl Clone for Declaration
Source§fn clone(&self) -> Declaration
fn clone(&self) -> Declaration
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Declaration
impl Debug for Declaration
Source§impl Default for Declaration
impl Default for Declaration
Source§fn default() -> Declaration
fn default() -> Declaration
Source§impl DefaultInstance for Declaration
impl DefaultInstance for Declaration
Source§fn default_instance() -> &'static Self
fn default_instance() -> &'static Self
Source§impl ExtensionSet for Declaration
impl ExtensionSet for Declaration
Source§const PROTO_FQN: &'static str = "google.protobuf.ExtensionRangeOptions.Declaration"
const PROTO_FQN: &'static str = "google.protobuf.ExtensionRangeOptions.Declaration"
"google.protobuf.FieldOptions". Read moreSource§fn unknown_fields(&self) -> &UnknownFields
fn unknown_fields(&self) -> &UnknownFields
Source§fn unknown_fields_mut(&mut self) -> &mut UnknownFields
fn unknown_fields_mut(&mut self) -> &mut UnknownFields
Source§fn extension<C>(&self, ext: &Extension<C>) -> <C as ExtensionCodec>::Outputwhere
C: ExtensionCodec,
fn extension<C>(&self, ext: &Extension<C>) -> <C as ExtensionCodec>::Outputwhere
C: ExtensionCodec,
Source§fn set_extension<C>(
&mut self,
ext: &Extension<C>,
value: <C as ExtensionCodec>::Value,
)where
C: ExtensionCodec,
fn set_extension<C>(
&mut self,
ext: &Extension<C>,
value: <C as ExtensionCodec>::Value,
)where
C: ExtensionCodec,
Source§fn has_extension<C>(&self, ext: &Extension<C>) -> boolwhere
C: ExtensionCodec,
fn has_extension<C>(&self, ext: &Extension<C>) -> boolwhere
C: ExtensionCodec,
true if any record at the extension’s field number is present. Read moreSource§fn clear_extension<C>(&mut self, ext: &Extension<C>)where
C: ExtensionCodec,
fn clear_extension<C>(&mut self, ext: &Extension<C>)where
C: ExtensionCodec,
Source§fn extension_or_default<C>(
&self,
ext: &Extension<C>,
) -> <C as ExtensionCodec>::Valuewhere
C: ExtensionCodec<Output = Option<<C as ExtensionCodec>::Value>>,
<C as ExtensionCodec>::Value: Default,
fn extension_or_default<C>(
&self,
ext: &Extension<C>,
) -> <C as ExtensionCodec>::Valuewhere
C: ExtensionCodec<Output = Option<<C as ExtensionCodec>::Value>>,
<C as ExtensionCodec>::Value: Default,
[default = ...]
value if absent, or the type’s Default if no proto default was declared. Read moreSource§impl Message for Declaration
impl Message for Declaration
Source§fn compute_size(&self, _cache: &mut SizeCache) -> u32
fn compute_size(&self, _cache: &mut SizeCache) -> u32
Returns the total encoded size in bytes.
The result is a u32; the protobuf specification requires all
messages to fit within 2 GiB (2,147,483,647 bytes), so a
compliant message will never overflow this type.
Source§fn write_to(&self, _cache: &mut SizeCache, buf: &mut impl BufMut)
fn write_to(&self, _cache: &mut SizeCache, buf: &mut impl BufMut)
cache (populated by a prior
compute_size call on the same cache). Read moreSource§fn merge_field(
&mut self,
tag: Tag,
buf: &mut impl Buf,
depth: u32,
) -> Result<(), DecodeError>
fn merge_field( &mut self, tag: Tag, buf: &mut impl Buf, depth: u32, ) -> Result<(), DecodeError>
buf. Read moreSource§fn encode(&self, buf: &mut impl BufMut)
fn encode(&self, buf: &mut impl BufMut)
Source§fn encode_with_cache(&self, cache: &mut SizeCache, buf: &mut impl BufMut)
fn encode_with_cache(&self, cache: &mut SizeCache, buf: &mut impl BufMut)
SizeCache, for
reuse across many encodes in a hot loop. Clears the cache first.Source§fn encoded_len(&self) -> u32
fn encoded_len(&self) -> u32
Source§fn encode_length_delimited(&self, buf: &mut impl BufMut)
fn encode_length_delimited(&self, buf: &mut impl BufMut)
Source§fn encode_to_bytes(&self) -> Bytes
fn encode_to_bytes(&self) -> Bytes
bytes::Bytes. Read moreSource§fn decode(buf: &mut impl Buf) -> Result<Self, DecodeError>where
Self: Sized,
fn decode(buf: &mut impl Buf) -> Result<Self, DecodeError>where
Self: Sized,
Source§fn decode_from_slice(data: &[u8]) -> Result<Self, DecodeError>where
Self: Sized,
fn decode_from_slice(data: &[u8]) -> Result<Self, DecodeError>where
Self: Sized,
Source§fn decode_length_delimited(buf: &mut impl Buf) -> Result<Self, DecodeError>where
Self: Sized,
fn decode_length_delimited(buf: &mut impl Buf) -> Result<Self, DecodeError>where
Self: Sized,
Source§fn merge_to_limit(
&mut self,
buf: &mut impl Buf,
depth: u32,
limit: usize,
) -> Result<(), DecodeError>
fn merge_to_limit( &mut self, buf: &mut impl Buf, depth: u32, limit: usize, ) -> Result<(), DecodeError>
Source§fn merge_group(
&mut self,
buf: &mut impl Buf,
depth: u32,
field_number: u32,
) -> Result<(), DecodeError>
fn merge_group( &mut self, buf: &mut impl Buf, depth: u32, field_number: u32, ) -> Result<(), DecodeError>
buf, reading fields until an
EndGroup tag with the given field_number is encountered. Read moreSource§fn merge(&mut self, buf: &mut impl Buf, depth: u32) -> Result<(), DecodeError>
fn merge(&mut self, buf: &mut impl Buf, depth: u32) -> Result<(), DecodeError>
Source§fn merge_from_slice(&mut self, data: &[u8]) -> Result<(), DecodeError>
fn merge_from_slice(&mut self, data: &[u8]) -> Result<(), DecodeError>
Source§fn merge_length_delimited(
&mut self,
buf: &mut impl Buf,
depth: u32,
) -> Result<(), DecodeError>
fn merge_length_delimited( &mut self, buf: &mut impl Buf, depth: u32, ) -> Result<(), DecodeError>
Source§impl MessageName for Declaration
impl MessageName for Declaration
Source§const PACKAGE: &'static str = "google.protobuf"
const PACKAGE: &'static str = "google.protobuf"
Source§const NAME: &'static str = "ExtensionRangeOptions.Declaration"
const NAME: &'static str = "ExtensionRangeOptions.Declaration"
. between nesting levels. Read moreSource§impl PartialEq for Declaration
impl PartialEq for Declaration
Source§fn eq(&self, other: &Declaration) -> bool
fn eq(&self, other: &Declaration) -> bool
self and other values to be equal, and is used by ==.