facet_format_toml/
lib.rs

1//! TOML serialization for facet using the new format architecture.
2//!
3//! This is the successor to `facet-toml`, using the unified `facet-format` traits.
4//!
5//! # Deserialization
6//!
7//! ```
8//! use facet::Facet;
9//! use facet_format_toml::from_str;
10//!
11//! #[derive(Facet, Debug)]
12//! struct Config {
13//!     name: String,
14//!     port: u16,
15//! }
16//!
17//! let toml = r#"
18//! name = "my-app"
19//! port = 8080
20//! "#;
21//!
22//! let config: Config = from_str(toml).unwrap();
23//! assert_eq!(config.name, "my-app");
24//! assert_eq!(config.port, 8080);
25//! ```
26
27extern crate alloc;
28
29mod error;
30mod parser;
31mod serializer;
32
33pub use error::{TomlError, TomlErrorKind};
34pub use parser::{TomlParser, TomlProbe, from_str};
35pub use serializer::{SerializeOptions, TomlSerializeError, TomlSerializer, to_string, to_vec};