Crate facet_format_toml

Crate facet_format_toml 

Source
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_format_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§

SerializeOptions
Options for TOML serialization.
TomlError
Error type for TOML operations.
TomlParser
Streaming TOML parser backed by toml_parser.
TomlProbe
Probe stream for TOML.
TomlSerializeError
TomlSerializer
TOML serializer with configurable formatting options.

Enums§

TomlErrorKind
Specific error kinds for TOML operations

Functions§

from_str
Deserialize a TOML string into a type.
to_string
Serialize a value to a TOML string
to_vec
Serialize a value to TOML bytes