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:

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)?;