Expand description
A human-readable ID which is safe to use as a component in a URI path.
and supports constant Label
s.
Features:
hash
: enable support forasync-hash
serde
: enable support forserde
stream
: enable support fordestream
uuid
: enable support foruuid
Example:
use hr_id::{label, Id, Label};
const HELLO: Label = label("hello"); // unchecked!
let world: Id = "world".parse().expect("id");
assert_eq!(format!("{}, {}!", HELLO, world), "hello, world!");
assert_eq!(Id::from(HELLO), "hello");
assert!(Id::from_str("this string has whitespace").is_err());
Structs§
- A human-readable ID
- A static label which implements
Into<Id>
. - An error encountered while parsing an
Id
.
Constants§
- A set of prohibited character patterns.
Functions§
- Return a
Label
with the given staticstr
.