rustapi-toon
Lens: "The Diplomat"
Philosophy: "Optimizing for Silicon Intelligence."
Token-Oriented Object Notation (TOON) support for RustAPI.
What is TOON?
Token-Oriented Object Notation is a format designed to be consumed by Large Language Models (LLMs). It reduces token usage by stripping unnecessary syntax (braces, quotes) while maintaining semantic structure.
Token Savings
TOON often reduces token count by 30-50% compared to JSON, saving significant costs and context window space when communicating with models like GPT-4 or Gemini.
Comparison
JSON (Expensive)
TOON (Optimized)
users[3]{id,role,active}:
1,admin,true
2,user,true
3,user,false
Content Negotiation
The LlmResponse<T> type automatically negotiates the response format based on the Accept header.
async
Usage
RustAPI handles this transparently via content negotiation.
use Toon;
// Accepts explicit TOON or JSON automatically based on Content-Type
async