Expand description
§OTOML - Canonical TOML Serialization
This crate provides OTOML serialization functionality and canonical types:
OTime- UTC timestamp (4 bytes)OCur- Currency amount (integer micro-units)OLocation- Geographic location (10 bytes)OAddress- Planet-scale civic address
It also provides serialization functions:
dump_otoml/load_otoml- Text serializationdump_obin/load_obin- Binary serialization
§OtomlSerialize Trait
The OtomlSerialize trait provides convenient instance methods for any
type that implements Serialize + DeserializeOwned:
ⓘ
use herolib_otoml::OtomlSerialize;
let user = User::default();
// Instance methods
let otoml = user.to_otoml()?;
let json = user.to_json()?;
// Factory methods
let user = User::from_otoml(&otoml)?;
let user = User::from_json(&json)?;Structs§
- OAddress
- Planet-scale civic address.
- OAddress
Ref - External reference identifiers for address lookup.
- OCur
- Canonical currency/asset amount type.
- OLocation
- Canonical geographic location with uncertainty radius.
- OTime
- Canonical UTC timestamp with second precision.
Enums§
- Otoml
Error - Errors that can occur during OTOML serialization or deserialization.
Constants§
- MICRO_
UNITS - Scale factor: 1 unit = 1,000,000 micro-units
Traits§
- Otoml
Serialize - Extension trait providing OTOML and JSON serialization methods.
Functions§
- dump_
obin - Serialize a value to compact OBIN binary format.
- dump_
otoml - Serialize a value to canonical OTOML text string.
- load_
obin - Deserialize OBIN binary data into a value.
- load_
otoml - Deserialize an OTOML/TOML text string into a value.
- normalize_
keys - Normalize keys in a TOML string to snake_case.
Type Aliases§
- Result
- Result type alias for OTOML operations.