pub struct Doi(/* private fields */);Expand description
A Digital Object Identifier, e.g. 10.1145/3368089.
Canonical form is ASCII-lowercased (DOIs are case-insensitive over ASCII;
non-ASCII characters are left untouched) with no doi: or URL wrapper.
URL forms are percent-decoded; bare and prefixed forms are taken literally.
Trailing . , ; : are stripped. The DOI spec technically permits a
suffix ending in one, but in practice that is far rarer than a DOI copied
with the end of its sentence, and a wrong DOI is caught later by lookup.
Implementations§
Source§impl Doi
impl Doi
Sourcepub fn with_trailing_punctuation(input: &str) -> Option<Doi>
pub fn with_trailing_punctuation(input: &str) -> Option<Doi>
The DOI as written with the trailing punctuation that parsing
strips, if input had any ("10.1145/x." → 10.1145/x.). DOIs may
legally end in .; callers retry with this when the stripped form
isn’t found.
The one exception to the parse/display round trip: parsing this value’s display strips the punctuation again. Use it for lookups only.