serde_toon
Library Listed
A Serde-compatible TOON (Token-Oriented Object Notation) serialization library
- Downloads
- 2,384
- Dependents
- 4
- Stars
- 13
- Forks
- 1
- Contributors
- 2
- Commits
- 4
- Latest release
- 0.3.0 ·
About
A Serde encoder and decoder for TOON, the Token-Oriented Object Notation.
What is TOON?
TOON is a compact encoding of the JSON data model built for LLM prompts: arrays of uniform objects become tables whose field names appear once. serde_toon implements spec v4.1.
JSON, 155 characters:
[
{ "id": 1, "name": "Alice", "email": "alice@example.com", "active": true },
{ "id": 2, "name": "Bob", "email": "bob@example.com", "active": false }
]
TOON, 89 characters:
[2]{id,name,email,active}:
1,Alice,alice@example.com,true
2,Bob,bob@example.com,false
See examples/token_efficiency.rs.
Quick start
[dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_toon = "0.3"
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, PartialEq)]
struct User {
id: u32,
name: String,
tags: Vec<String>,
}
fn main() -> Result<(), serde_toon::Error> {
let user = User { id: 7, name: "Ada".into(), tags: vec!["admin".into(), "ops".into()] };
let toon = serde_toon::to_string(&user)?;
assert_eq!(toon, "id: 7\nname: Ada\ntags[2]: admin,ops");
let back: User = serde_toon::from_str(&toon)?;
assert_eq!(back, user);
Ok(())
}
Read the full README
Dynamic values
use serde_toon::toon;
fn main() -> Result<(), serde_toon::Error> {
let data = toon!({
"users": [
{"id": 1, "name": "Alice"},
{"id": 2, "name": "Bob"}
],
"active": true
});
println!("{}", serde_toon::to_string(&data)?);
Ok(())
}
See examples/dynamic_values.rs and examples/macro.rs.
Strict decoding
from_str is lenient. For untrusted or LLM-generated input, strict mode enforces the spec's validation rules and reports where the input went wrong:
use serde_toon::{from_str_with_options, DecodeOptions, Value};
fn main() {
// The header declares 3 rows but only 2 follow.
let input = "users[3]{id,name}:\n 1,Ada\n 2,Bob";
let err = from_str_with_options::<Value>(input, DecodeOptions::strict()).unwrap_err();
assert!(err.to_string().contains("line 1"));
}
See examples/strict_decoding.rs.
Features
- TOON spec v4.1, passing all 538 official conformance tests
- Full Serde integration: derives, enums, maps,
Option, 128-bit integers - Zero-copy decoding:
&strfields borrow from the input - Three decoding modes: strict, lenient, and compatible with 0.2 output
- Configurable delimiter (comma, tab, pipe) and indentation
- Errors with line and column
- No unsafe code; MSRV 1.70
Compatibility with 0.2
The Rust API is unchanged, but 0.3 writes spec-compliant TOON, so the serialized text differs: there are no [#N] markers, fields keep declaration order, and NaN becomes null. from_str still reads everything 0.2 wrote. See the changelog.
Performance
Encoding and decoding are 2-4.6x faster than 0.2 (changelog). Compared with the official toon-format crate (benches/vs_toon_format.rs):
| Workload | Encode | Decode |
|---|---|---|
| Tabular, 10k rows | 3.3 ms vs 32.7 ms | 2.7 ms vs 17.9 ms |
| Nested | 0.17 ms vs 1.43 ms | 0.19 ms vs 0.87 ms |
| Strings | 0.11 ms vs 0.59 ms | 0.15 ms vs 0.68 ms |
Documentation
License
MIT OR Apache-2.0
Compatibility
- Runs on
- GPU support unknown
What shows it
- no dependency or feature matches a backend row
- Native code
- None found
- No native code found
- Python bindings
- No Python binding crate found
- License
- Apache-2.0 OR MIT
Compare with similar projects
Order: strongest tier first, then most downloads, then name, with unmeasured values last. A library counts downloads over 30 days. An app counts binary downloads per release. An app with none counts its crate downloads over 30 days. ML Rust runs this catalogue, so its closest project always gets a row.
| Project | Downloads | Dependents | Stars | Latest release | Runs on (GPU) | Native code | License |
|---|---|---|---|---|---|---|---|
|
A Serde-compatible TOON (Token-Oriented Object Notation) serialization library |
2,384 downloads over 30 days | 4 | 13 | 0.3.0 | GPU support unknown | No native code found | Apache-2.0 OR MIT |
|
pdf_oxide Featured
The fastest Rust PDF library — 0.8ms mean, 5× faster than the industry leaders, 100% pass rate on 3,830 real-world PDFs. Text extraction, Markdown/HTML conversion, PDF creation and editing. Python bindings |
316,729 downloads over 30 days | 30 | 1,180 | 0.3.78 | GPU support unknown | Binds native code: aws-lc-rs (feature fips), lcms2-sys (feature icc-lcms2), ort-sys (feature gpu) | Apache-2.0 OR MIT |
|
toon-rust Featured
Token-Oriented Object Notation (TOON) - a token-efficient JSON alternative for LLM prompts |
160,383 downloads over 30 days | 67 | 190 | 0.7.0 | GPU support unknown | No native code found | MIT |
|
Pure Rust PDF library for AI/RAG: structure-aware chunking, no ML, no C deps. |
62,285 downloads over 30 days | Not applicable | 194 | 5.5.7 | GPU support unknown | No native code found | MIT |
|
Token-Oriented Object Notation – a token-efficient JSON alternative for LLM prompts |
8,018 downloads over 30 days | 5 | 22 | 0.1.2 | GPU support unknown | No native code found | MIT |
|
edgeparse Listed
EdgeParse core library — PDF parsing and structured data extraction |
6,764 downloads over 30 days | 2 | 155 | 0.3.2 | GPU support unknown | No native code found | Apache-2.0 |
|
Inference server for LLMs, speech and embeddings: OpenAI-compatible routes with streaming, plus speech synthesis (TTS) and transcription (ASR). Serves Llama, Mistral, Qwen, Mamba2, MLA+MoE and hybrid models from SafeTensors, AWQ, GPTQ and GGUF. |
8 binary downloads per release | Not applicable | 7 | 0.7.1 | CUDA, WebGPU | Binds native code: ring (feature distributed) | Apache-2.0 |
Why ListedNo archive, New or Featured rule places it, so it is Listed.
What it lacks for Featured
- It has 3 active dependents and 3 new dependents in 365 days. Featured needs 11 active dependents or 9 new dependents in 365 days. The repository route reads 13 stars, 1 fork and 2 contributors. It needs 4,539 stars, 434 forks and 79 contributors together.
What else the check found
- The last activity is on 30 Sep 2026, 40 days ago. The rules expect an update within 365 days. Dormancy rule
Exact rules: Listed, Featured library. The check on applied thresholds version 9.
Every rule outcome, as the check records it
expected-interval: version 0.3.0 base 80, raised to the 365-day floor: E = 365 daysdormancy: last activity 2026-09-30, 40 days ago, E = 365: activefeatured: not featured: active_users 3 < 11 and new_adopters 3 < 9 and repository route stars 13 (needs 4539), forks 1 (needs 434), contributors 2 (needs 79)listed: listed: no archive, new or featured rule applies
Measurements and sources
Each signal row shows the raw value, its source and the fetch date. The Sources list gathers every distinct source on this page. Movement needs more history.
Sources6 sources
- Description: the crates.io description
- crates.io database dump, fetched
- RustSec advisory database, fetched
- GitHub repository, fetched
- crates.io package, fetched
- GitHub contributors, fetched
Adoption3 active dependents, 3 new dependents in 365 days1 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Active dependents | 3 | crates.io database dump | Yes | |
| New dependents (365 days) | 3 | crates.io database dump | Yes | |
| Peak active dependents | 3 | crates.io database dump | Yes | |
| Active dependents as a share of the peak | 1 | crates.io database dump | Yes | |
| Binary downloads per release | Not measured | Yes |
MaintenanceLatest human commit: 40 days ago3 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Latest human commit | 2026-09-30 | GitHub repository | Yes | |
| Latest release | 2026-09-30 | crates.io database dump | Yes | |
| First release | 2025-10-29 | crates.io database dump | Yes | |
| Latest version | 0.3.0 | crates.io database dump | Yes | |
| Days the oldest outside issue waits for a reply | 0 | GitHub repository | Yes | |
| Maintainer replies over 365 days | 0 | GitHub repository | Yes | |
| Repository archived | false | GitHub repository | Yes | |
| Repository gone | false | GitHub repository | Yes | |
| Release commit or manifest in the repo | true | crates.io package | Yes | |
| Published docs | true | crates.io database dump | Yes | |
| Latest release fails cargo check | Not measured | Yes | ||
| Build check date | Not measured | Yes | ||
| Build check toolchain | Not measured | Yes |
SecurityUnpatched vulnerabilities: none
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Unpatched vulnerabilities past the grace window | none | RustSec advisory database | Yes | |
| RustSec unmaintained advisory | none | RustSec advisory database | Yes | |
| Deprecation notice | none | crates.io database dump | Yes | |
| Deprecated requirement | none | crates.io database dump | Yes |
Distribution4 releases, 2,384 downloads over 30 days5 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Releases | 4 | crates.io database dump | Yes | |
| Downloads over 30 days | 2384 | crates.io database dump | Yes | |
| Binary downloads over the last 3 releases | Not measured | Yes | ||
| Homebrew installs on request over 365 days | Not measured | Yes | ||
| Repology repository families | Not measured | Yes | ||
| Docker pull growth over 90 days | Not measured | Yes | ||
| Docker pulls at the growth baseline | Not measured | Yes | ||
| Every version a prerelease | false | crates.io database dump | Yes | |
| Every version 0.0.x | false | crates.io database dump | Yes | |
| Every version yanked | false | crates.io database dump | Yes | |
| Crate deleted from crates.io | false | crates.io database dump | Yes |
Repository13 stars, 1 forks, 2 contributors, 4 commits. Stars alone never qualify a project.
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| GitHub stars | 13 | GitHub repository | Yes — one part of the repository route | |
| GitHub forks | 1 | GitHub repository | Yes — one part of the repository route | |
| Contributors with a GitHub account | 2 | GitHub contributors | Yes — one part of the repository route | |
| Commits on the default branch | 4 | GitHub repository | No | |
| Repository's main crate left out of the entry | none | crates.io database dump | Yes |
Facts that never count
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| License | Apache-2.0 OR MIT | crates.io database dump | No | |
| Runs on, from listed crates and their direct dependencies | GPU support unknown | crates.io database dump | No | |
| What shows each backend | no dependency or feature matches a backend row | crates.io database dump | No | |
| Native code, from listed crates and their dependencies | No native code found | crates.io database dump | No | |
| Python bindings, from direct dependencies of listed crates | No Python binding crate found | crates.io database dump | No | |
| Crates that depend on a listed crate directly | 4 | crates.io database dump | No |
Corrections and review history
No correction applies to this entry.
Judgments
A judgment enters only through an approved issue and a merged pull request.
No judgment applies to this entry.