rustapi-toon
TOON (Token-Oriented Object Notation) support for RustAPI framework.
What is TOON?
TOON is a compact, human-readable format designed for passing structured data to Large Language Models (LLMs) with significantly reduced token usage (typically 20-40% savings).
Quick Example
JSON (16 tokens, 40 bytes):
TOON (13 tokens, 28 bytes) - 18.75% token savings:
users[2]{id,name}:
1,Alice
2,Bob
Usage
Add to your Cargo.toml:
[]
= { = "0.1", = ["toon"] }
Toon Extractor
Parse TOON request bodies:
use *;
use Toon;
async
Toon Response
Return TOON formatted responses:
use *;
use Toon;
async
Content Types
- Request:
application/toonortext/toon - Response:
application/toon
License
MIT OR Apache-2.0