pub struct Tag { /* private fields */ }Expand description
One element’s identity.
Implementations§
Source§impl Tag
impl Tag
Sourcepub fn beyond_naming(class: Class, constructed: bool) -> Self
pub fn beyond_naming(class: Class, constructed: bool) -> Self
A tag whose number is wider than this reader names.
Every such tag is the same tag here, which is what its class and construction say and nothing more. Two documents writing different wide numbers are still told apart by their bytes, which is what identity is compared on; what this decides is only that neither matches a tag a schema names.
Sourcepub fn constructed(number: u32) -> Self
pub fn constructed(number: u32) -> Self
A universal constructed tag, the common case for containers.
Sourcepub fn context(constructed: bool, number: u32) -> Self
pub fn context(constructed: bool, number: u32) -> Self
A context-specific tag, as written [n] in a module.
Sourcepub fn is_constructed(self) -> bool
pub fn is_constructed(self) -> bool
Whether the contents are further elements rather than a value.
Sourcepub fn number(self) -> Option<u32>
pub fn number(self) -> Option<u32>
The number within the class, where it is one this reader names.
None is a number too wide for that, which no schema assigns and
nothing here interprets. A caller matching against the numbers it
knows gets no match, which is the answer.
Sourcepub fn is_end_of_contents(self) -> bool
pub fn is_end_of_contents(self) -> bool
Whether this is the end-of-contents marker that closes an indefinite-length element.