macro_rules! define_id {
($name:ident, $desc:expr) => { ... };
}Expand description
Macro for defining typed identifiers backed by Id16.
Each generated type wraps an Id16 and exposes the same API:
generate(), from_bytes(), as_bytes(), to_hex(), from_hex(),
and Display.
§Example
ⓘ
define_id!(MyIdentifier, "my identifier");
let id = MyIdentifier::generate();
let hex = id.to_hex();
let restored = MyIdentifier::from_hex(&hex).unwrap();
assert_eq!(id, restored);