A Rust crate for handling
URNs. Parsing
and comparison is done according to the spec (meaning only part of the
URN is used for equality checks). Some RFCs define per-namespace lexical
equivalence rules, those aren't taken into account here. no_std
support is available if you disable the default "std" feature. alloc
is needed, but the Urn type is a wrapper around String and should
only use a single allocation (but I haven't checked). You can even
construct a Urn from your own String by using TryFrom<String>,
that way it shouldn't allocate at all.
URNs have a surprising amount of obscure details to the point I'm not sure if other URN parsers can be trusted! Granted, there's very little of them because almost nobody really needs URNs...
FromStr implUrn::parse function in favor of FromStr, improved
docsNamespace (thanks to
u/chris-morgan for help)Clone impl for UrnUrnBuilder::namespace -> UrnBuilder::nidalloc feature, add UrnSlice type, add percent
module, don't impl Deref<Target = str>. The crate is getting close
to 1.0.TL;DR do whatever you want.
Licensed under either the BSD Zero Clause License (https://opensource.org/licenses/0BSD), the Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0) or the MIT License (http://opensource.org/licenses/MIT), at your choice.