# toml (toml-rs)

> TOML encoder, decoder and format-preserving editor for Rust

Source: https://talira.ai/catalog/toml-toml-rs-wdqvw27j
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [developer tools / serialization](https://talira.ai/categories/developer-tools/serialization)
- Licence: MIT OR Apache-2.0[^1][^2]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Supports: [TOML](https://talira.ai/standards/toml.md)[^3]
- Backed by: [toml-rs](https://talira.ai/orgs/toml-rs.md)

toml is the Rust crate for reading and writing TOML: a [Serde](https://talira.ai/catalog/serde-4erjakm9.md)-compatible decoder and encoder that turns TOML files into Rust structures and back. Its sibling crate toml_edit parses and modifies TOML documents while keeping their comments, spacing and the order of items, which is what cargo-edit needs; the same repository has toml_datetime, serde_spanned for spans of keys and values, and the low-level toml_parser and toml_writer. It is dual licensed under MIT or Apache-2.0.

## Links

- GitHub: https://github.com/toml-rs/toml
- Docs: https://docs.rs/toml

## Problems it solves

- read my Rust app's config file written in TOML
- change a value in a Cargo.toml without losing its comments
- write Rust structs out as a TOML file

## Features

- serde Serialize and Deserialize for TOML
- format-preserving editing that keeps comments, spacing and order (toml_edit)
- spans of keys and values when deserializing (serde_spanned)
- low-level TOML lexer, parser and writer

## Trust

Overall: 0.64 out of 1.
Signals: maintenance 1.00, adoption 0.61, momentum 0.31, community 0.89, backing 0.30, extensibility 0.00.

- last commit 5 days ago
- 119 commits in the last 90 days
- 1.1k GitHub stars
- 166 contributors
- accepts sponsorship (Github)
- backed by toml-rs

## Alternatives

- [Serde](https://talira.ai/catalog/serde-4erjakm9.md): Rust's framework for serializing and deserializing data structures

## Sources

[^1]: https://github.com/toml-rs/toml/blob/main/crates/toml/README.md (checked 28 Nov 2026)
[^2]: https://github.com/toml-rs/toml/blob/main/Cargo.toml (checked 28 Nov 2026)
[^3]: https://docs.rs/toml/latest/toml/ (checked 29 Nov 2026)
