#[non_exhaustive]pub enum ElementRef<'a> {
Scalar {
tag: Tag,
value: ValueRef<'a>,
},
ContainerStart {
tag: Tag,
kind: ContainerKind,
},
ContainerEnd,
}Expand description
One step of the streaming reader, borrowing string/bytes payloads from
the input — the zero-copy sibling of Element. Produced by
TlvReader::next_ref; convert with Element::from when ownership is
needed.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Scalar
A complete scalar (or string/bytes) element.
Fields
ContainerStart
A container has just been opened (see Element::ContainerStart).
Fields
§
kind: ContainerKindWhich container kind was opened.
ContainerEnd
The most recently-opened container has been closed.
Trait Implementations§
Source§impl<'a> Clone for ElementRef<'a>
impl<'a> Clone for ElementRef<'a>
Source§fn clone(&self) -> ElementRef<'a>
fn clone(&self) -> ElementRef<'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 moreimpl<'a> Copy for ElementRef<'a>
Source§impl<'a> Debug for ElementRef<'a>
impl<'a> Debug for ElementRef<'a>
Source§impl From<ElementRef<'_>> for Element
impl From<ElementRef<'_>> for Element
Source§fn from(e: ElementRef<'_>) -> Self
fn from(e: ElementRef<'_>) -> Self
Converts to this type from the input type.
Source§impl<'a> PartialEq for ElementRef<'a>
impl<'a> PartialEq for ElementRef<'a>
impl<'a> StructuralPartialEq for ElementRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for ElementRef<'a>
impl<'a> RefUnwindSafe for ElementRef<'a>
impl<'a> Send for ElementRef<'a>
impl<'a> Sync for ElementRef<'a>
impl<'a> Unpin for ElementRef<'a>
impl<'a> UnsafeUnpin for ElementRef<'a>
impl<'a> UnwindSafe for ElementRef<'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