pub struct Tei { /* private fields */ }Expand description
A parsed TEI that still carries its original character sequence.
Implementations§
Source§impl Tei
impl Tei
Sourcepub fn parse(input: &str) -> Result<Self, TeiError>
pub fn parse(input: &str) -> Result<Self, TeiError>
Parse tei://<domain-name>/<type>/<unique-identifier>.
The returned value displays as the input. This function does not lowercase the domain, decode Base64URL, or rewrite percent-escapes.
§Errors
Returns an error when the text is not a structurally valid TEI.
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Original spelling, used for equality and for the tei query parameter.
Sourcepub fn identifier(&self) -> &str
pub fn identifier(&self) -> &str
Unique-identifier segment, still in its TEI spelling.
Sourcepub fn well_known_url(&self) -> String
pub fn well_known_url(&self) -> String
https://<domain>/.well-known/tea, using the domain spelling as written.
Sourcepub fn validate_registry(&self) -> Result<(), TeiError>
pub fn validate_registry(&self) -> Result<(), TeiError>
Check the unique identifier against the TEI type registry at the pinned commit.
Unknown types are structurally valid and return Ok(()). Their
identifiers are not given extra syntax beyond the single path segment.
§Errors
Returns an error when a registered type’s identifier syntax is not met.
Sourcepub fn publication_issues(&self) -> Vec<String>
pub fn publication_issues(&self) -> Vec<String>
Publication-form issues that do not make the TEI unparsable.
The discovery document requires vendors to publish a canonical spelling
and requires clients not to rewrite a TEI they received. These issues
are reported separately from Self::parse.