pub struct UnknownFieldsView<'a> { /* private fields */ }Expand description
A borrowed view of unknown fields.
Stores raw byte slices from the input buffer rather than decoded values, enabling zero-copy round-tripping of unknown fields.
Implementations§
Source§impl<'a> UnknownFieldsView<'a>
impl<'a> UnknownFieldsView<'a>
Sourcepub fn encoded_len(&self) -> usize
pub fn encoded_len(&self) -> usize
Total byte length of all unknown field data.
Sourcepub fn to_owned(&self) -> Result<UnknownFields, DecodeError>
pub fn to_owned(&self) -> Result<UnknownFields, DecodeError>
Convert to an owned UnknownFields by parsing all stored raw byte spans.
Each span is a complete (tag + value) record as it appeared on the wire.
Parsing uses crate::encoding::decode_unknown_field with the full
recursion limit so deeply nested group fields are handled correctly.
§Errors
Returns Err if any stored span is malformed — which should not occur
when the view was produced by decode_view from valid wire data.
Trait Implementations§
Source§impl<'a> Clone for UnknownFieldsView<'a>
impl<'a> Clone for UnknownFieldsView<'a>
Source§fn clone(&self) -> UnknownFieldsView<'a>
fn clone(&self) -> UnknownFieldsView<'a>
Returns a duplicate of the value. Read more
1.0.0 · 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 UnknownFieldsView<'a>
impl<'a> Debug for UnknownFieldsView<'a>
Source§impl<'a> Default for UnknownFieldsView<'a>
impl<'a> Default for UnknownFieldsView<'a>
Source§fn default() -> UnknownFieldsView<'a>
fn default() -> UnknownFieldsView<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'a> Freeze for UnknownFieldsView<'a>
impl<'a> RefUnwindSafe for UnknownFieldsView<'a>
impl<'a> Send for UnknownFieldsView<'a>
impl<'a> Sync for UnknownFieldsView<'a>
impl<'a> Unpin for UnknownFieldsView<'a>
impl<'a> UnsafeUnpin for UnknownFieldsView<'a>
impl<'a> UnwindSafe for UnknownFieldsView<'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