pub struct ElementSpan { /* private fields */ }Expand description
Byte offsets of one element within a TlvReader’s input, produced by
TlvReader::element_span / TlvReader::skip_container_span.
Two-form contract:
- Scalar span — after
next()/next_ref()returns aScalar, the span covers the complete element;bodystarts after the tag bytes (for strings it includes the length field, whose width form lives in the element type). - Container span — after
next()returnsContainerStartthe span covers only the container header; callskip_container_spanfor the full container, whosebodycovers the children plus the end-of-container marker and EXCLUDES the original control/tag bytes. ContainerEndspan — afternext()returnsContainerEnd, the span covers the 1-byte end-of-container marker andbodyis empty.
Resolve ranges against the input with TlvReader::span_bytes.
Implementations§
Trait Implementations§
Source§impl Clone for ElementSpan
impl Clone for ElementSpan
Source§fn clone(&self) -> ElementSpan
fn clone(&self) -> ElementSpan
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 Copy for ElementSpan
Source§impl Debug for ElementSpan
impl Debug for ElementSpan
impl Eq for ElementSpan
Source§impl PartialEq for ElementSpan
impl PartialEq for ElementSpan
impl StructuralPartialEq for ElementSpan
Auto Trait Implementations§
impl Freeze for ElementSpan
impl RefUnwindSafe for ElementSpan
impl Send for ElementSpan
impl Sync for ElementSpan
impl Unpin for ElementSpan
impl UnsafeUnpin for ElementSpan
impl UnwindSafe for ElementSpan
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