Crate hr_id

source · []
Expand description

Provides a human-readable Id and static Label

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>.

Constants

Functions

Return a Label with the given static str.

Type Definitions