| Crates.io | armature-toon |
| lib.rs | armature-toon |
| version | 0.1.1 |
| created_at | 2025-12-27 02:21:47.276152+00 |
| updated_at | 2025-12-29 01:33:22.833698+00 |
| description | TOON (Token-Oriented Object Notation) support for Armature framework - optimized for LLM applications |
| homepage | https://pegasusheavy.github.io/armature |
| repository | https://github.com/pegasusheavy/armature |
| max_upload_size | |
| id | 2006583 |
| size | 74,392 |
TOON (Token-Oriented Object Notation) integration for the Armature framework.
[dependencies]
armature-toon = "0.1"
use armature_toon::{to_string, from_str, Toon};
use serde::{Serialize, Deserialize};
#[derive(Serialize, Deserialize)]
struct User {
name: String,
age: u32,
}
fn main() -> Result<(), Box<dyn std::error::Error>> {
let user = User { name: "Alice".into(), age: 30 };
// Serialize to TOON
let toon = to_string(&user)?;
// Deserialize from TOON
let parsed: User = from_str(&toon)?;
Ok(())
}
use armature_toon::ToonResponseExt;
async fn handler(req: HttpRequest) -> Result<HttpResponse, Error> {
let user = User { name: "Alice".into(), age: 30 };
HttpResponse::toon(user)
}
| Format | Tokens | Savings |
|---|---|---|
| JSON | 100 | - |
| TOON | 45 | 55% |
MIT OR Apache-2.0