Expand description
A human-readable ID which is safe to use as a component in a URI path.
and supports constant Labels.
Features:
hash: enable support forasync-hashserde: enable support forserdestream: enable support fordestreamuuid: 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§
- Id
- A human-readable ID
- Label
- A static label which implements
Into<Id>. - Parse
Error - An error encountered while parsing an
Id.
Constants§
- RESERVED_
CHARS - A set of prohibited character patterns.