Expand description
TOML serialization for facet using the new format architecture.
This is the successor to facet-toml, using the unified facet-format traits.
§Deserialization
use facet::Facet;
use facet_toml::from_str;
#[derive(Facet, Debug)]
struct Config {
name: String,
port: u16,
}
let toml = r#"
name = "my-app"
port = 8080
"#;
let config: Config = from_str(toml).unwrap();
assert_eq!(config.name, "my-app");
assert_eq!(config.port, 8080);Structs§
- Serialize
Options - Options for TOML serialization.
- Toml
Error - Error type for TOML operations.
- Toml
Parser - Streaming TOML parser backed by
toml_parser. - Toml
Probe - Probe stream for TOML.
- Toml
Serialize Error - Toml
Serializer - TOML serializer with configurable formatting options.
Enums§
- Deserialize
Error - Error produced by the format deserializer.
- Toml
Error Kind - Specific error kinds for TOML operations
Functions§
- from_
slice - Deserialize a value from TOML bytes into an owned type.
- from_
slice_ borrowed - Deserialize a value from TOML bytes, allowing zero-copy borrowing.
- from_
str - Deserialize a value from a TOML string into an owned type.
- from_
str_ borrowed - Deserialize a value from a TOML string, allowing zero-copy borrowing.
- to_
string - Serialize a value to a TOML string
- to_
string_ with_ options - Serialize a value to a TOML string with custom options.
- to_vec
- Serialize a value to TOML bytes