Crate hr_id

source ·
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 for async-hash
  • serde: enable support for serde
  • stream: enable support for destream
  • uuid: enable support for uuid

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§

Functions§