herolib_otoml 0.3.13

OTOML - Canonical TOML serialization format with compact binary representation.
Documentation
//! # 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 serialization
//! - [`dump_obin`] / [`load_obin`] - Binary serialization
//!
//! ## OtomlSerialize Trait
//!
//! The [`OtomlSerialize`] trait provides convenient instance methods for any
//! type that implements `Serialize + DeserializeOwned`:
//!
//! ```rust,ignore
//! 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)?;
//! ```

mod binary;
mod canonical;
mod error;
mod oaddress;
mod ocur;
mod olocation;
mod otime;
mod serde_ext;

pub use binary::{dump_obin, load_obin};
pub use canonical::{dump_otoml, load_otoml, normalize_keys};
pub use error::{OtomlError, Result};
pub use oaddress::{OAddress, OAddressRef};
pub use ocur::{OCur, MICRO_UNITS};
pub use olocation::OLocation;
pub use otime::OTime;
pub use serde_ext::OtomlSerialize;