toml

A native Rust encoder and decoder for TOML with first-class Serde support.

Library
Cargo
v1.1.8+spec-1.1.0
1,085 stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
75 /100 Good
Development Activity 92
Maintenance 52
Community 68
Maturity 60
Momentum 28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
89 /100 Excellent
Architecture 88
Code Quality 90
Innovation 90
Learning Curve 85

toml is a native Rust library for reading and writing TOML, the configuration format used by Cargo and much of the Rust ecosystem. It implements the standard Serde Serialize and Deserialize traits, so you can turn a TOML document straight into strongly typed Rust structs and serialize them back out with the same derive macros you already use for JSON or YAML.

Beyond struct mapping, it exposes a dynamic Table and Value model for working with arbitrary documents, supports no_std targets, and can preserve key order when built with the appropriate feature. It sits atop a focused stack of sibling crates (toml_parser, toml_edit, toml_datetime, toml_writer) that power format-preserving editing and low-level parsing when you need them.

What You Get

  • Serde-powered from_str / to_string helpers that map TOML directly to and from typed Rust structs
  • A dynamic Table and Value model for reading arbitrary documents without a predefined schema
  • Spec-compliant parsing validated against the official toml-test suite for both decoding and encoding
  • no_std support and optional features for preserving map key order and tuning hashing
  • Access to sibling crates (toml_edit, toml_parser) for format-preserving edits and low-level control

Common Use Cases

  • Loading application and tool configuration files into typed settings structs
  • Reading and writing Cargo-style manifest and metadata files
  • Serializing Rust data structures out to human-readable TOML for storage or interchange
  • Inspecting TOML documents dynamically when the schema is not known ahead of time

Under The Hood

Architecture The crate is organized as the deserialization (src/de) and serialization (src/ser) halves of a Serde codec built on a dynamic data model in src/value.rs, src/table.rs, and src/map.rs. Parsing flows through the sibling toml_parser crate, which lexes and parses spans that are then materialized into typed Rust values or a Value tree; serialization mirrors this by walking values through a document strategy in src/ser/document and emitting text via toml_writer. It lives in a Cargo workspace alongside toml_edit, toml_datetime, and serde_spanned, each owning one concern so the top-level crate stays focused on the Serde surface.

Tech Stack It is written in Rust targeting the 2024 edition with a stated MSRV of 1.85. Core dependencies are serde_core for the trait plumbing, winnow as the parser-combinator engine behind toml_parser, and toml_datetime for TOML’s datetime type; optional dependencies include indexmap (for key-order preservation) and foldhash. Feature flags gate std, serde, parse, display, and preserve_order, allowing no_std and minimal builds.

Code Quality The crate carries an extensive test tree covering decoder and encoder behavior, serde round-trips, and snapshot fixtures, and it wires in the official toml-test conformance harness through custom decoder_compliance and encoder_compliance test targets. Clippy configuration and pre-commit hooks are checked in at the workspace root, and runnable examples (decode.rs, toml2json.rs) document real usage. The result is a mature, well-covered codebase rather than a thinly tested one.

API Design The public surface is deliberately small and predictable: toml::from_str and toml::to_string cover the common typed path, while a FromStr-based Table plus the Value enum handle dynamic access, so most users get productive with a single function call. Naming follows Serde conventions developers already know, thorough rustdoc is published on docs.rs, and heavier needs are cleanly delegated to toml_edit rather than bloating this crate’s API.

Used by 36 apps in this directory

Python
100%
Other

OpenBB

Analytics · Databases · Invoicing Finance

74,601

The AI Workspace for Finance: Connect Data, Run AI Agents, Build Analytics

View details
80
Repo Health
80
Technical
65
Dependency
Built with
Python 100%
Updated 1 weeks ago
C++
43%
MIT

openduck

Data Engineering · Databases

576

OpenDuck brings MotherDuck-style cloud capabilities to self-hosted DuckDB — attach remote databases, run hybrid queries across local and remote nodes, and own your data with an open gRPC and Arrow IPC protocol.

View details
26
Repo Health
76
Technical
76
Dependency
Built with
C++ 43%
Rust 38%
HTML 13%
Updated 5 months ago
Python
73%
AGPL 3.0

OpenViking

AI Development · AI Memory · Databases

40,705

An open-source context database that gives AI agents a unified filesystem for memory, resources, and skills with hierarchical tiered retrieval.

View details
85
Repo Health
75
Technical
64
Dependency
Built with
Python 73%
TypeScript 12%
Rust 11%
Updated 5 days ago
Rust
85%
AGPL 3.0

ParadeDB

Analytics · Databases · Search

9,436

Born out of Y Combinator's S2023 batch, ParadeDB is a Postgres extension that delivers Elasticsearch-quality BM25 search and real-time analytics without a separate search cluster to manage.

View details
89
Repo Health
87
Technical
68
Dependency
Built with
Rust 85%
PLpgSQL 15%
Updated 5 days ago
Rust
63%
MIT

PostgresML

AI Development · Databases

6,823

Run ML training and LLM inference natively inside PostgreSQL with GPU acceleration — no data movement required.

View details
51
Repo Health
76
Technical
64
Dependency
Built with
Rust 63%
JavaScript 11%
Updated 1 years ago
Rust
79%
AGPL 3.0

Spacedrive

Collaboration · File Storage

39,292

One file manager for all your devices and clouds — powered by a Virtual Distributed File System built in Rust.

View details
84
Repo Health
84
Technical
63
Dependency
Built with
Rust 79%
TypeScript 18%
Updated 2 weeks ago
Rust
46%
MIT

Svix

Automation · Developer Tools

3,463

Open source, self-hostable webhook infrastructure that handles delivery, retries, HMAC signing, and multi-tenant event management so you never have to build a webhooks system from scratch.

View details
91
Repo Health
77
Technical
67
Dependency
Built with
Rust 46%
C# 16%
Updated 6 days ago
Rust
66%
Apache 2.0

Temps

Analytics · Devops · Monitoring

865

A self-hosted Rust PaaS that replaces Vercel, Sentry, PostHog, Pingdom, Resend, and E2B with one binary — plus 440+ CLI operations agents like Claude Code can drive directly.

View details
81
Repo Health
86
Technical
66
Dependency
Built with
Rust 66%
TypeScript 33%
Updated 6 days ago
Rust
50%
Apache 2.0

Vibe Kanban

AI Agents · AI Code Assistants · Project Management

28,441

A kanban board for planning work and dispatching Claude Code, Codex, Gemini CLI, and eight other coding agents into isolated git worktrees, then reviewing and merging their diffs from one UI.

View details
72
Repo Health
75
Technical
63
Dependency
Built with
Rust 50%
TypeScript 46%
Updated 1 months ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers