TOON Format for Rust
Token-Oriented Object Notation is a compact, human-readable format designed for passing structured data to Large Language Models with significantly reduced token usage.
Status
🚧 This crate is currently a namespace reservation. Full implementation coming soon!
What is TOON?
TOON achieves 30-60% token reduction compared to JSON by:
- Eliminating repetitive keys in arrays of objects
- Using indentation instead of braces
- Declaring structure upfront with explicit lengths and field names
- Minimal quoting for string values
Example
JSON (verbose):
TOON (compact):
users[2]{id,name,role}:
1,Alice,admin
2,Bob,user
Resources
Future Usage
Once implemented, the crate will provide:
use ;
let data = // your data structure
let toon_string = encode?;
let decoded = decode?;
Contributing
Interested in implementing TOON for Rust? Check out the specification and feel free to contribute!
License
MIT License © 2025-PRESENT Johann Schopplich