toml
A native Rust encoder and decoder of TOML-formatted files and streams. Provides implementations of the standard Serialize/Deserialize traits for TOML data to facilitate deserializing and serializing Rust structures.
1.1.4+spec-1.1.0
838M downloads/mo
#77 most downloaded on crates.io
toml-rs/toml
What this package is like to depend on
Last release 26 days ago
28 Jul 2026
Release timing varies
gaps range from 8 days to 3 months
Some releases are documented
notes for 40 of 115 stable releases
3 versions withdrawn
withdrawn after publishing
12 years old
118 releases · first in 2014
20 releases in the last 12 months
see the full history below
Release timeline
118 releases · Nov 2014 to Jul 2026Releases
latest 60 of 118-
1.1.4+spec-1.1.028 Jul 2026Nothing published for this version
-
1.1.3+spec-1.1.014 Jul 2026Nothing published for this version
-
1.1.2+spec-1.1.001 Apr 2026Nothing published for this version
-
1.1.1+spec-1.1.031 Mar 2026Nothing published for this version
-
1.1.0+spec-1.1.023 Mar 2026Nothing published for this version
-
1.0.7+spec-1.1.017 Mar 2026Nothing published for this version
-
1.0.6+spec-1.1.006 Mar 2026Nothing published for this version
-
1.0.5+spec-1.1.006 Mar 2026Nothing published for this version
-
1.0.4+spec-1.1.004 Mar 2026Nothing published for this version
-
1.0.3+spec-1.1.018 Feb 2026Nothing published for this version
-
1.0.2+spec-1.1.016 Feb 2026Nothing published for this version
-
1.0.1+spec-1.1.012 Feb 2026Nothing published for this version
-
1.0.0+spec-1.1.011 Feb 2026Nothing published for this version
-
0.9.12+spec-1.1.010 Feb 2026Nothing published for this version
-
0.9.11+spec-1.1.009 Jan 2026Nothing published for this version
-
0.9.10+spec-1.1.018 Dec 2025Nothing published for this version
-
0.9.9+spec-1.0.017 Dec 2025Nothing published for this version
-
0.9.809 Oct 2025 -
0.9.718 Sep 2025 -
0.9.615 Sep 2025 -
0.9.504 Aug 2025Release notes
Open source →Fixes
- Improve missing-open-quote errors
- Don't treat trailing quotes as separate items
- Conjoin more values in unquoted string errors
- Reduce float false positives
- Reduce float/bool false positives
-
0.9.430 Jul 2025Release notes
Open source →Features
- Add
DeInteger::as_strandDeInteger::radixfor converting to desired integer types - Add
DeFloat::as_strfor converting to desired floating-point types
- Add
-
0.9.328 Jul 2025 -
0.9.211 Jul 2025 -
0.9.110 Jul 2025Nothing published for this version
-
0.9.008 Jul 2025Release notes
Open source →Migration
- If you set
default-features = false, runcargo add toml -F serde,std - Resolve errors as you come across them
Compatibility
Breaking Changes
from_str,Deserializer, etc no longer preserve order, requiring thepreserve_orderfeature likeTable- Serde support has been broken out into the default
serdefeature - Std support has been broken out into the default
stdfeature - Fail quickly when deserializing a value without a
Spanned impl FromStr for Valuenow parses TOML values, not documentsDeserializer::new/ValueDeserializer::newnow return errorsSerializer::newandSerializer::prettynow take a&mut Buffer, rather than a&mut String<Serializer<'d> as serde::ser::Serializer>::Okis now&'d mut Buffer<ValueSerializer<'d> as serde::ser::Serializer>::Okis now&'d mut String
Other
- New TOML parser and writer which carries a risk for regressions
- Deprecated
Deserializer::new/ValueDeserializer::newin favor ofDeserializer::parse/ValueDeserializer::parse
Performance
- Added
fast_hashfeature
Features
- Add
Spanned<DeTable<'input>>as aserde-less, zero-copy, span tracking format to parse to, with error recovery - Add
de::from_slice - Add
Table::remove_entry debugfeature for easier debugging- Added
FromandIntoDeserializerimpls forDeserializer/ValueDeserializer - Added big-integer, big-float, u64, u128, and i128 support to
serdeandDeValue(but notValue)
Fixes
impl FromStr for Valuenow parses TOML values, not documents
- If you set
-
0.8.2306 Jun 2025Release notes
Open source →Fixes
- (serde) Serialize struct variants
- (serde) Serialize tuple variants under their variant name
-
0.8.2228 Apr 2025Release notes
Open source →Fixes
- (serde) Skip key-value pairs where the value is a newtype wrapping
None
- (serde) Skip key-value pairs where the value is a newtype wrapping
-
0.8.2125 Apr 2025Release notes
Open source →Features
- Add
unboundedfeature to bypass recursion depth checks
Fixes
- Reduced escaping in strings without a prior formatting
Compatibility
- Serializing a
Tableno longer has a specific sub-table order - Strings have changed formats
- A trailing single quote no longer prevents "pretty" strings
- Double quotes in ml-basic-strings are only escaped if there are 3 or more
- Presence of 1-2 double quotes and newlines no longer forces the use of ml-literal instead ml-basic-string
- Add
-
0.8.2005 Feb 2025 -
0.8.1931 Jul 2024 -
0.8.1831 Jul 2024 -
0.8.1730 Jul 2024Release notes
Open source →Performance
- Speed up whitespace parsing
- Speed up empty array parsing
- Speed up general array parsing
- Speed up general value parsing
Features
- impl Serialize/Deserialize for Date/Time
Fixes
- When recursion depth is reached, be sure to show that error rather than something else
-
0.8.1625 Jul 2024Nothing published for this version
-
0.8.1517 Jul 2024 -
0.8.1403 Jun 2024Release notes
Open source →Fixes
- Allow inferring keys as string literals
- Prefer string literals if it avoids escaping double-quotes
-
0.8.1315 May 2024Nothing published for this version
-
0.8.1218 Mar 2024Release notes
Open source →Fixes
- Drop recursion limit from 128 to 100 to work on
opt-level = 0builds
- Drop recursion limit from 128 to 100 to work on
-
0.8.1111 Mar 2024Release notes
Open source →Performance
- (de) Remove an allocation when parsing
Compatibility
MSRV is now 1.70
-
0.8.1005 Feb 2024 -
0.8.931 Jan 2024Release notes
Open source →Fixes
- (de) Improve error span for empty tables
Compatibility
MSRV is now 1.69
-
0.8.806 Nov 2023Release notes
Open source →Compatibility
- If you relied on
tomlto enabletoml_editparseordisplayfeatures, it will no longer work
- If you relied on
-
0.8.706 Nov 2023Nothing published for this version
-
0.8.627 Oct 2023 -
0.8.526 Oct 2023Release notes
Open source →Fixes
- (parser) Ensure the sign of NAN is preserved
- (serde) Ensure the sign of NAN is preserved
-
0.8.423 Oct 2023Release notes
Open source →Fixes
- (parser) Error on invalid days of month, accounting for leap years
-
0.8.323 Oct 2023 -
0.8.203 Oct 2023Release notes
Open source →Fixes
- (parser) Correctly error when mixing inline tables with inline dotted keys
-
0.8.126 Sep 2023 -
0.8.013 Sep 2023Release notes
Open source →Compatibility
- Serialization and deserialization of tuple variants has changed from being an array to being a table with the key being the variant name and the value being the array
Fixes
- Consistently serialize and deserialize struct and tuple variants, matching serde_json's behavior
-
0.7.809 Sep 2023Release notes
Open source →Fixes
- (ser) Don't lose data when inline tables are nested deeply under arrays
-
0.7.708 Sep 2023Release notes
Open source →Fixes
- (ser) Error rather than drop whole arrays when a single element is
None
Compatibility
MSRV is now 1.66.0
- (ser) Error rather than drop whole arrays when a single element is
-
0.7.605 Jul 2023 -
0.7.524 Jun 2023 -
0.7.418 May 2023 -
0.7.313 Mar 2023Release notes
Open source →Fixes
- Don't skip writing standard tables that are "underneath" dotted keys
-
0.7.207 Feb 2023 -
0.7.130 Jan 2023 -
0.7.027 Jan 2023Release notes
Open source →Breaking Change
Offset::Customchanged from tracking hours+minutes to minutesOffset::Customs parser now enforces a range of minutes- Removed deprecated
Error::line_colinfavor ofError::span - Removed deprecated
ser::tables_lastas it isn't needed anymore - Removed deprecagted
Serializer::pretty_*functions astoml_editis for greater customization
Fixes
- Allow negative minute
Offsets
-
0.6.023 Jan 2023Release notes
Open source →Compatibility
Breaking Behavior Changes
FromStrimpl forValuenow only parses toml values, not documents. See insteadTableDisplayimpl forValuenow only renders toml values, not documents. See insteadTablefrom_strnow only parses toml documents, not values. See insteadde::ValueDeserializerto_string/to_string_prettynow only renders toml documents, not values. See insteadser::ValueSerializer
Breaking API Changes
de::from_sliceandser::to_vecwere removed, instead usefrom_strandto_stringand convert with bytes manuallytoml!returns aTable, rather than aValuetoml::decan no longer deserialize to borrowed types as everything becomes owned through the parsing processserde::de::Deserializeris now implemented fortoml::Deserializer, rather than&mut toml::Deserializerserde::ser::Serializeris now implemented fortoml::Serializer, rather than&mut toml::Serializervalueno longer re-exportsMapandEntrySpanned::spans return type changed tostd::ops::Range<usize>Spanned::startremoved in favor ofSpanned::span().startSpanned::wndremoved in favor ofSpanned::span().endparseanddisplaydefault features were addedtoml::ser::Errors variants are private. Fortoml::ser::Error::Custom, you can useserde::ser::Error::custom- Deprecated items from 0.5 were removed
Deprecations
- Deprecated
Deserializer::tables_last, it is no longer needed - Deprecated
Deserializer::pretty_string, this is all bundled up withpretty - Deprecated
Deserializer::pretty_string_literal, this is all bundled up withpretty - Deprecated
Deserializer::pretty_array, this is all bundled up withpretty - Deprecated
Deserializer::pretty_array_indent, this is all bundled up withpretty - Deprecated
Deserializer::pretty_array_trailing_comma, this is all bundled up withpretty - Deprecated
de::Error::line_col, replaced withde::Error::span
MSRV is now 1.60.0
Features
Tablenow implsDisplay,FromStr,DeserializeTablenow hastry_fromandtry_intomethods- Added
de::ValueDeserializerandser::ValueSerializerfor exclusively working with toml values - Provide
de::Error::spanandde::Error::message, allowing custom error rendering
Fixes
- Bring the parser into full TOML 1.0 compliance
- (parse) Improve the quality of spans in
Spanned/ errors - (display) Automatically handle root key-value pairs vs tables, removing the need for
tables_last - (display) Fix problems with stray
,being inserted when using array of tables - (error) Show the error locatation in the source for parse and deserialize errors