Trait confget::backend::Backend

source ·
pub trait Backend<'cfg> {
    // Required methods
    fn from_config(config: &'cfg Config) -> Result<Self, ConfgetError>
       where Self: Sized;
    fn read_file(&self) -> Result<DataRead, ConfgetError>;
}
Expand description

A backend that implements parsing a specific type of configuration data.

A Backend object may be constructed manually using Backend::from_config, but it may be preferable to use the get_backend or read_ini_file functions instead.

Required Methods§

source

fn from_config(config: &'cfg Config) -> Result<Self, ConfgetError>where Self: Sized,

Initialize a backend object, performing config checks if necessary.

Errors

See the documentation of the individual backends.

source

fn read_file(&self) -> Result<DataRead, ConfgetError>

Obtain and parse the input data in a backend-specific way.

Errors

See the documentation of the individual backends.

Implementors§

source§

impl<'cfg> Backend<'cfg> for IniNomBackend<'cfg>

source§

impl<'cfg> Backend<'cfg> for IniREBackend<'cfg>