pub struct EnumValueView<'a> {
pub name: &'a str,
pub number: i32,
pub options: RepeatedView<'a, OptionView<'a>>,
pub __buffa_unknown_fields: UnknownFieldsView<'a>,
}Expand description
Enum value definition.
New usages of this message as an alternative to EnumValueDescriptorProto are strongly discouraged. This message does not reliability preserve all information necessary to model the schema and preserve semantics. Instead make use of FileDescriptorSet which preserves the necessary information.
Fields§
§name: &'a strEnum value name.
Field 1: name
number: i32Enum value number.
Field 2: number
options: RepeatedView<'a, OptionView<'a>>Protocol buffer options.
Field 3: options
__buffa_unknown_fields: UnknownFieldsView<'a>Trait Implementations§
Source§impl<'a> Clone for EnumValueView<'a>
impl<'a> Clone for EnumValueView<'a>
Source§fn clone(&self) -> EnumValueView<'a>
fn clone(&self) -> EnumValueView<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for EnumValueView<'a>
impl<'a> Debug for EnumValueView<'a>
Source§impl<'a> Default for EnumValueView<'a>
impl<'a> Default for EnumValueView<'a>
Source§fn default() -> EnumValueView<'a>
fn default() -> EnumValueView<'a>
Returns the “default value” for a type. Read more
Source§impl<'v> DefaultViewInstance for EnumValueView<'v>
impl<'v> DefaultViewInstance for EnumValueView<'v>
Source§fn default_view_instance<'a>() -> &'a Selfwhere
Self: 'a,
fn default_view_instance<'a>() -> &'a Selfwhere
Self: 'a,
Return a reference to the single default view instance. Read more
Source§impl<'a> MessageName for EnumValueView<'a>
impl<'a> MessageName for EnumValueView<'a>
Source§const PACKAGE: &'static str = "google.protobuf"
const PACKAGE: &'static str = "google.protobuf"
The protobuf package the message is declared in. Read more
Source§const NAME: &'static str = "EnumValue"
const NAME: &'static str = "EnumValue"
The unqualified message name, with
. between nesting levels. Read moreSource§impl<'a> MessageView<'a> for EnumValueView<'a>
impl<'a> MessageView<'a> for EnumValueView<'a>
Source§fn decode_view(buf: &'a [u8]) -> Result<Self, DecodeError>
fn decode_view(buf: &'a [u8]) -> Result<Self, DecodeError>
Decode a view from a buffer, borrowing string/bytes fields directly. Read more
Source§fn decode_view_with_ctx(
buf: &'a [u8],
ctx: DecodeContext<'_>,
) -> Result<Self, DecodeError>
fn decode_view_with_ctx( buf: &'a [u8], ctx: DecodeContext<'_>, ) -> Result<Self, DecodeError>
Decode a view under custom decode limits. Read more
Source§fn merge_view_field(
&mut self,
tag: Tag,
cur: &'a [u8],
before_tag: &'a [u8],
ctx: DecodeContext<'_>,
) -> Result<&'a [u8], DecodeError>
fn merge_view_field( &mut self, tag: Tag, cur: &'a [u8], before_tag: &'a [u8], ctx: DecodeContext<'_>, ) -> Result<&'a [u8], DecodeError>
Decode one field’s payload into this view (generated per message). Read more
Source§fn to_owned_message(&self) -> Result<EnumValue, DecodeError>
fn to_owned_message(&self) -> Result<EnumValue, DecodeError>
Convert this view to the owned message type. Read more
Source§fn to_owned_from_source(
&self,
__buffa_src: Option<&Bytes>,
) -> Result<EnumValue, DecodeError>
fn to_owned_from_source( &self, __buffa_src: Option<&Bytes>, ) -> Result<EnumValue, DecodeError>
Convert this view to the owned message type, optionally slicing
bytes::Bytes-typed fields from source instead of copying. Read moreSource§fn decode_view_ctx(
buf: &'a [u8],
ctx: DecodeContext<'_>,
) -> Result<Self, DecodeError>where
Self: Default,
fn decode_view_ctx(
buf: &'a [u8],
ctx: DecodeContext<'_>,
) -> Result<Self, DecodeError>where
Self: Default,
Decode a view under an explicit
DecodeContext
(remaining recursion depth, unknown-field allowance, and element-memory
budget), driving the provided tag loop over
merge_view_field. Read moreSource§fn merge_into_view(
&mut self,
buf: &'a [u8],
ctx: DecodeContext<'_>,
) -> Result<(), DecodeError>
fn merge_into_view( &mut self, buf: &'a [u8], ctx: DecodeContext<'_>, ) -> Result<(), DecodeError>
Merge fields from
buf into this view (proto merge semantics):
repeated fields append, singular fields last-wins, singular message
fields merge recursively. Read moreSource§impl<'a> ReflectElement for EnumValueView<'a>
Available on crate feature reflect only.
impl<'a> ReflectElement for EnumValueView<'a>
Available on crate feature
reflect only.Source§fn as_value_ref(&self) -> ValueRef<'_>
fn as_value_ref(&self) -> ValueRef<'_>
Borrow this element as a
ValueRef.Source§impl<'a> ReflectMessage for EnumValueView<'a>
Available on crate feature reflect only.
impl<'a> ReflectMessage for EnumValueView<'a>
Available on crate feature
reflect only.Source§fn message_descriptor(&self) -> &MessageDescriptor
fn message_descriptor(&self) -> &MessageDescriptor
The descriptor for this message type.
Source§fn pool(&self) -> &Arc<DescriptorPool> ⓘ
fn pool(&self) -> &Arc<DescriptorPool> ⓘ
The pool the descriptor lives in. Use this to dereference
MessageIndex /
EnumIndex from FieldKind,
or Arc::clone it to construct sibling DynamicMessages while
navigating nested fields.Source§fn for_each_set(&self, f: &mut dyn FnMut(&FieldDescriptor, ValueRef<'_>))
fn for_each_set(&self, f: &mut dyn FnMut(&FieldDescriptor, ValueRef<'_>))
Visit every set field. Read more
Source§fn to_dynamic(&self) -> DynamicMessage
fn to_dynamic(&self) -> DynamicMessage
Snapshot this message as an owned
DynamicMessage. Read moreSource§fn unknown_fields(&self) -> &UnknownFields
fn unknown_fields(&self) -> &UnknownFields
The fields preserved from decode that the message’s descriptor does
not recognize. Read more
Source§fn which_oneof(&self, oneof: &OneofDescriptor) -> Option<&FieldDescriptor>
fn which_oneof(&self, oneof: &OneofDescriptor) -> Option<&FieldDescriptor>
Which member of
oneof is set, if any. Read moreSource§impl<'a> ViewEncode<'a> for EnumValueView<'a>
impl<'a> ViewEncode<'a> for EnumValueView<'a>
Source§fn compute_size(&self, __cache: &mut SizeCache) -> u32
fn compute_size(&self, __cache: &mut SizeCache) -> u32
Source§fn write_to(&self, __cache: &mut SizeCache, buf: &mut impl EncodeSink)
fn write_to(&self, __cache: &mut SizeCache, buf: &mut impl EncodeSink)
Write this view’s encoded bytes to a buffer, consuming
nested-message sizes from
cache (populated by a prior
compute_size call on the same cache). Read moreSource§fn encode(&self, buf: &mut impl EncodeSink)
fn encode(&self, buf: &mut impl EncodeSink)
Compute size, then write. Primary view-encode entry point. Read more
Source§fn try_encode(&self, buf: &mut impl EncodeSink) -> Result<(), EncodeError>
fn try_encode(&self, buf: &mut impl EncodeSink) -> Result<(), EncodeError>
Encode, returning an error instead of panicking if the encoded size
exceeds the 2 GiB protobuf limit
(
MAX_MESSAGE_BYTES). Read moreSource§fn encode_with_cache(&self, cache: &mut SizeCache, buf: &mut impl EncodeSink)
fn encode_with_cache(&self, cache: &mut SizeCache, buf: &mut impl EncodeSink)
Source§fn try_encode_with_cache(
&self,
cache: &mut SizeCache,
buf: &mut impl EncodeSink,
) -> Result<(), EncodeError>
fn try_encode_with_cache( &self, cache: &mut SizeCache, buf: &mut impl EncodeSink, ) -> Result<(), EncodeError>
Encode with a caller-supplied
SizeCache,
returning an error instead of panicking if the encoded size exceeds
the 2 GiB protobuf limit (MAX_MESSAGE_BYTES).
Clears the cache first. Read moreSource§fn try_encode_bounded(
&self,
max_bytes: u32,
buf: &mut impl EncodeSink,
) -> Result<u32, EncodeError>
fn try_encode_bounded( &self, max_bytes: u32, buf: &mut impl EncodeSink, ) -> Result<u32, EncodeError>
Encode this view into
buf only if its encoded size fits within
max_bytes, using a single size pass that is then reused for the write. Read moreSource§fn try_encode_bounded_with_cache(
&self,
max_bytes: u32,
cache: &mut SizeCache,
buf: &mut impl EncodeSink,
) -> Result<u32, EncodeError>
fn try_encode_bounded_with_cache( &self, max_bytes: u32, cache: &mut SizeCache, buf: &mut impl EncodeSink, ) -> Result<u32, EncodeError>
Source§fn encoded_len(&self) -> u32
fn encoded_len(&self) -> u32
Compute the encoded byte size of this view. Read more
Source§fn try_encoded_len(&self) -> Result<u32, EncodeError>
fn try_encoded_len(&self) -> Result<u32, EncodeError>
Compute the encoded byte size, returning an error instead of
panicking if it exceeds the 2 GiB protobuf limit
(
MAX_MESSAGE_BYTES). Read moreSource§fn encode_length_delimited(&self, buf: &mut impl EncodeSink)
fn encode_length_delimited(&self, buf: &mut impl EncodeSink)
Encode this view as a length-delimited byte sequence. Read more
Source§fn try_encode_length_delimited(
&self,
buf: &mut impl EncodeSink,
) -> Result<(), EncodeError>
fn try_encode_length_delimited( &self, buf: &mut impl EncodeSink, ) -> Result<(), EncodeError>
Encode as a length-delimited byte sequence, returning an error
instead of panicking if the encoded size exceeds the 2 GiB protobuf
limit (
MAX_MESSAGE_BYTES). Read moreSource§fn try_encode_to_vec(&self) -> Result<Vec<u8>, EncodeError>
fn try_encode_to_vec(&self) -> Result<Vec<u8>, EncodeError>
Encode to a new
Vec<u8>, returning an error instead of panicking
if the encoded size exceeds the 2 GiB protobuf limit
(MAX_MESSAGE_BYTES). Read moreSource§fn encode_to_bytes(&self) -> Bytes
fn encode_to_bytes(&self) -> Bytes
Encode this view to a new
bytes::Bytes. Read moreSource§fn try_encode_to_bytes(&self) -> Result<Bytes, EncodeError>
fn try_encode_to_bytes(&self) -> Result<Bytes, EncodeError>
Encode to a new
bytes::Bytes, returning an error instead of
panicking if the encoded size exceeds the 2 GiB protobuf limit
(MAX_MESSAGE_BYTES). Read moreSource§impl ViewReborrow for EnumValueView<'static>
impl ViewReborrow for EnumValueView<'static>
Source§type Reborrowed<'b> = EnumValueView<'b>
type Reborrowed<'b> = EnumValueView<'b>
The same view type with its lifetime shortened to
'b.Source§fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b>
fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b>
Coerce
&'b Self (= &'b FooView<'static>) to
&'b Self::Reborrowed<'b> (= &'b FooView<'b>). The canonical body
is just this; the compiler accepts it via standard lifetime
variance for covariant view types. Read moreAuto Trait Implementations§
impl<'a> Freeze for EnumValueView<'a>
impl<'a> RefUnwindSafe for EnumValueView<'a>
impl<'a> Send for EnumValueView<'a>
impl<'a> Sync for EnumValueView<'a>
impl<'a> Unpin for EnumValueView<'a>
impl<'a> UnsafeUnpin for EnumValueView<'a>
impl<'a> UnwindSafe for EnumValueView<'a>
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