ubl-types
Shared canonical types for Universal Business Ledger (UBL).
Note: UBL = Universal Business Ledger (not OASIS Universal Business Language).
Features
Identity Types
AppId,TenantId,NodeId,ActorId,TraceId— String-based newtypes withDisplay/FromStrDim— Protocol dimension (u16) with hex/decimal parsing
Cryptographic Primitives
Cid32— 32-byte content ID (BLAKE3) with hex serializationPublicKeyBytes— 32-byte Ed25519 public keySignatureBytes— 64-byte Ed25519 signatureIntent— Textual intent with canonical bytes (whitespace-insensitive)
Error Types
AtomError— Shared basic errors
Installation
[]
= "0.1"
# Optional features
= { = "0.1", = ["ulid", "strict"] }
Quick Example
use ;
use FromStr;
// Dimension parsing
let dim = parse.unwrap;
assert_eq!;
// CID with hex serialization
let cid = Cid32;
println!; // lowercase hex
// Intent normalization (whitespace-insensitive)
let i1 = from_raw;
let i2 = from_raw;
assert_eq!;
// Identity newtypes
let app = from_str.unwrap;
println!;
Feature Flags
| Feature | Description |
|---|---|
std (default) |
Standard library support |
ulid |
ULID generators for TraceId/ActorId |
strict |
Regex validation for ID newtypes |
License
MIT OR Apache-2.0 © LogLine Foundation