Skip to main content

Provider

Trait Provider 

Source
pub trait Provider: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn load(&self, settings: &mut Settings) -> Result;

    // Provided method
    fn reload_token(&self) -> Box<dyn ChangeToken> { ... }
}
Expand description

Defines the behavior of an object that provides configuration settings.

Required Methods§

Source

fn name(&self) -> &str

Gets the name of the provider.

Source

fn load(&self, settings: &mut Settings) -> Result

Loads the provided configuration.

§Arguments
  • settings - The settings to load the configured values into

Provided Methods§

Source

fn reload_token(&self) -> Box<dyn ChangeToken>

Returns a change token that indicates when this provider has changed.

Implementors§

Source§

impl Provider for config::chained::Provider

Available on crate feature chained only.
Source§

impl Provider for config::cmd::Provider

Available on crate feature cmd only.
Source§

impl Provider for config::env::Provider

Available on crate feature env only.
Source§

impl Provider for config::ini::Provider

Available on crate feature ini only.
Source§

impl Provider for config::json::Provider

Available on crate feature json only.
Source§

impl Provider for config::mem::Provider

Available on crate feature mem only.
Source§

impl Provider for config::xml::Provider

Available on crate feature xml only.
Source§

impl Provider for config::yaml::Provider

Available on crate feature yaml only.
Source§

impl<T: Serialize + Send + Sync> Provider for config::typed::Provider<T>

Available on crate feature typed only.