pub struct SpanSet {
pub spans: Vec<Span>,
}Expand description
An ordered cover of an input by lexical spans.
Fields§
§spans: Vec<Span>Spans in ascending, non-overlapping order.
Implementations§
Source§impl SpanSet
impl SpanSet
Sourcepub fn total_len(&self) -> u64
pub fn total_len(&self) -> u64
Sum of all span lengths. Saturates rather than panicking on absurd input.
Sourcepub fn validate(&self, declared_len: u64) -> Result<()>
pub fn validate(&self, declared_len: u64) -> Result<()>
Require a contiguous cover of exactly [0, declared_len).
Returns crate::ErrorClass::CoverageViolation for a gap, overlap,
wrong total, or length overflow, and
crate::ErrorClass::InvalidPdfStructure for a degenerate zero-length
span. This is the internal self-check that turns a scanner bug into a
loud classified failure instead of silent byte loss.
Trait Implementations§
impl Eq for SpanSet
impl StructuralPartialEq for SpanSet
Auto Trait Implementations§
impl Freeze for SpanSet
impl RefUnwindSafe for SpanSet
impl Send for SpanSet
impl Sync for SpanSet
impl Unpin for SpanSet
impl UnsafeUnpin for SpanSet
impl UnwindSafe for SpanSet
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