serde_toon
A Serde-compatible TOON serialization library for Rust.
What is TOON?
TOON (Token-Oriented Object Notation) is a compact format for LLMs, using 30-60% fewer tokens than JSON.
Example - Same data, different size:
// JSON (191 chars)
// TOON (83 chars - 56% smaller)
:
true,alice@example.com,1,Alice
true,bob@example.com,2,Bob
See examples/token_efficiency.rs
Quick Start
[]
= "0.1"
= { = "1.0", = ["derive"] }
use ;
use ;
let user = User ;
let toon = to_string?;
let back: User = from_str?;
Features
- Full Serde integration
- Zero-copy deserialization
- Comprehensive error messages
- Multiple array formats
- No unsafe code
Documentation
See https://docs.rs/serde_toon
License
MIT OR Apache-2.0