pub struct Toml;
Available on crate feature toml only.
Expand description

A TOML Format Data provider. See Data for details.

use figment::providers::{Format, Toml};

// Source directly from a source string...
let provider = Toml::string("source-string");

// Or read from a file on disk.
let provider = Toml::file("path-to-file");

See also toml::from_str for parsing details.

Trait Implementations

The data format’s error type.

The name of the data format, for instance "JSON" or "TOML".

Parses string as the data format Self as a T or returns an error if the string is an invalid T. Read more

Parses the file at path as the data format Self as a T or returns an error if the string is an invalid T. The default implementation calls Format::from_str() with the contents of the file. Read more

Returns a Data provider that sources its values by parsing the file at path as format Self. See Data::file() for more details. The default implementation calls Data::file(path). Read more

Returns a Data provider that sources its values by parsing string as format Self. See Data::string() for more details. The default implementation calls Data::string(string). Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.