pub struct Element<'a> { /* private fields */ }Expand description
One element, as it was found.
Implementations§
Source§impl<'a> Element<'a>
impl<'a> Element<'a>
Sourcepub fn contents(self) -> &'a [u8] ⓘ
pub fn contents(self) -> &'a [u8] ⓘ
The contents, borrowed from the document.
For an indefinite-length element this is everything up to but not including the end-of-contents marker.
Sourcepub fn as_bytes(self) -> &'a [u8] ⓘ
pub fn as_bytes(self) -> &'a [u8] ⓘ
The whole element as it arrived, header included.
What a signature is computed over wherever a schema says the signature covers an element as encoded, and what identity is compared on wherever a schema says two structures are the same one when their bytes are. Handing these back rather than re-encoding what was understood is the difference between checking a signature over the document somebody was sent and checking it over this parser’s opinion of that document.
Sourcepub fn contents_span(self) -> Span
pub fn contents_span(self) -> Span
Where the contents sit in the document.
Sourcepub fn span(self) -> Span
pub fn span(self) -> Span
Where the whole element sits, header included.
This is the range a signature is computed over wherever a schema says the signature covers an element as encoded.
Sourcepub fn is_indefinite(self) -> bool
pub fn is_indefinite(self) -> bool
Whether the length was written in the indefinite form.