| Crates.io | ubl-types |
| lib.rs | ubl-types |
| version | 0.1.0 |
| created_at | 2026-01-10 16:35:14.54104+00 |
| updated_at | 2026-01-10 16:35:14.54104+00 |
| description | UBL types: IDs + DIM, Display/FromStr, validator & helpers for Universal Business Ledger. |
| homepage | https://logline.foundation |
| repository | https://github.com/LogLine-Foundation/logline-workspace |
| max_upload_size | |
| id | 2034407 |
| size | 27,669 |
Shared canonical types for Universal Business Ledger (UBL).
Note: UBL = Universal Business Ledger (not OASIS Universal Business Language).
AppId, TenantId, NodeId, ActorId, TraceId — String-based newtypes with Display/FromStrDim — Protocol dimension (u16) with hex/decimal parsingCid32 — 32-byte content ID (BLAKE3) with hex serializationPublicKeyBytes — 32-byte Ed25519 public keySignatureBytes — 64-byte Ed25519 signatureIntent — Textual intent with canonical bytes (whitespace-insensitive)AtomError — Shared basic errors[dependencies]
ubl-types = "0.1"
# Optional features
ubl-types = { version = "0.1", features = ["ulid", "strict"] }
use ubl_types::{Cid32, Dim, Intent, AppId};
use core::str::FromStr;
// Dimension parsing
let dim = Dim::parse("0x00A1").unwrap();
assert_eq!(dim.as_u16(), 161);
// CID with hex serialization
let cid = Cid32([0xAB; 32]);
println!("cid = {cid}"); // lowercase hex
// Intent normalization (whitespace-insensitive)
let i1 = Intent::from_raw(" hello world ");
let i2 = Intent::from_raw("hello world");
assert_eq!(i1.as_bytes(), i2.as_bytes());
// Identity newtypes
let app = AppId::from_str("my-app").unwrap();
println!("app = {app}");
| Feature | Description |
|---|---|
std (default) |
Standard library support |
ulid |
ULID generators for TraceId/ActorId |
strict |
Regex validation for ID newtypes |
MIT OR Apache-2.0 © LogLine Foundation