pub struct BytesValueView<'a> {
pub value: &'a [u8],
pub __buffa_unknown_fields: UnknownFieldsView<'a>,
}Expand description
Wrapper message for bytes.
The JSON representation for BytesValue is JSON string.
Fields§
§value: &'a [u8]The bytes value.
Field 1: value
__buffa_unknown_fields: UnknownFieldsView<'a>Trait Implementations§
Source§impl<'a> Clone for BytesValueView<'a>
impl<'a> Clone for BytesValueView<'a>
Source§fn clone(&self) -> BytesValueView<'a>
fn clone(&self) -> BytesValueView<'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 BytesValueView<'a>
impl<'a> Debug for BytesValueView<'a>
Source§impl<'a> Default for BytesValueView<'a>
impl<'a> Default for BytesValueView<'a>
Source§fn default() -> BytesValueView<'a>
fn default() -> BytesValueView<'a>
Returns the “default value” for a type. Read more
Source§impl<'v> DefaultViewInstance for BytesValueView<'v>
impl<'v> DefaultViewInstance for BytesValueView<'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 BytesValueView<'a>
impl<'a> MessageName for BytesValueView<'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 = "BytesValue"
const NAME: &'static str = "BytesValue"
The unqualified message name, with
. between nesting levels. Read moreSource§impl<'a> MessageView<'a> for BytesValueView<'a>
impl<'a> MessageView<'a> for BytesValueView<'a>
Source§type Owned = BytesValue
type Owned = BytesValue
The corresponding owned message type.
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<BytesValue, DecodeError>
fn to_owned_message(&self) -> Result<BytesValue, DecodeError>
Convert this view to the owned message type. Read more
Source§fn to_owned_from_source(
&self,
__buffa_src: Option<&Bytes>,
) -> Result<BytesValue, DecodeError>
fn to_owned_from_source( &self, __buffa_src: Option<&Bytes>, ) -> Result<BytesValue, 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 and unknown-field allowance), 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 BytesValueView<'a>
Available on crate feature reflect only.
impl<'a> ReflectElement for BytesValueView<'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 BytesValueView<'a>
Available on crate feature reflect only.
impl<'a> ReflectMessage for BytesValueView<'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 Serialize for BytesValueView<'_>
Available on crate feature json only.
impl Serialize for BytesValueView<'_>
Available on crate feature
json only.Source§impl<'a> ViewEncode<'a> for BytesValueView<'a>
impl<'a> ViewEncode<'a> for BytesValueView<'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 BufMut)
fn write_to(&self, _cache: &mut SizeCache, buf: &mut impl BufMut)
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 BufMut)
fn encode(&self, buf: &mut impl BufMut)
Compute size, then write. Primary view-encode entry point.
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)
Encode using a caller-supplied
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
Compute the encoded byte size of this view. Read more
Source§fn encode_length_delimited(&self, buf: &mut impl BufMut)
fn encode_length_delimited(&self, buf: &mut impl BufMut)
Encode this view as a length-delimited byte sequence.
Source§fn encode_to_bytes(&self) -> Bytes
fn encode_to_bytes(&self) -> Bytes
Encode this view to a new
bytes::Bytes.Source§impl ViewReborrow for BytesValueView<'static>
impl ViewReborrow for BytesValueView<'static>
Source§type Reborrowed<'b> = BytesValueView<'b>
type Reborrowed<'b> = BytesValueView<'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 BytesValueView<'a>
impl<'a> RefUnwindSafe for BytesValueView<'a>
impl<'a> Send for BytesValueView<'a>
impl<'a> Sync for BytesValueView<'a>
impl<'a> Unpin for BytesValueView<'a>
impl<'a> UnsafeUnpin for BytesValueView<'a>
impl<'a> UnwindSafe for BytesValueView<'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