rustapi-toon

Crates.iorustapi-toon
lib.rsrustapi-toon
version0.1.207
created_at2026-01-01 11:24:07.315113+00
updated_at2026-01-26 00:03:22.896575+00
descriptionTOON (Token-Oriented Object Notation) support for RustAPI - LLM-optimized data format
homepage
repositoryhttps://github.com/Tuntii/RustAPI
max_upload_size
id2016074
size107,002
Tunay (Tuntii)

documentation

https://docs.rs/rustapi-toon

README

RustAPI TOON

Token-Oriented Object Notation (TOON) support.

🤖 What is TOON?

TOON is an experimental, density-optimized data format designed for High-Volume LLM Interactions.

When building agents or APIs that consume massive amounts of structured data via LLMs (GPT-4, Claude), standard JSON is token-expensive due to repeated keys and syntax overhead. TOON eliminates this redundancy.

Comparison

JSON (Expensive)

[
  {"id": 1, "role": "admin", "active": true},
  {"id": 2, "role": "user",  "active": true},
  {"id": 3, "role": "user",  "active": false}
]

TOON (Optimized)

users[3]{id,role,active}:
  1,admin,true
  2,user,true
  3,user,false

Usage

RustAPI handles this transparently via content negotiation.

use rustapi_toon::Toon;

// Accepts explicit TOON or JSON automatically based on Content-Type
#[post("/ingest")]
async fn ingest(Toon(data): Toon<Vec<User>>) -> impl Responder {
    // ...
}
Commit count: 208

cargo fmt