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§
sourcefn from_config(config: &'cfg Config) -> Result<Self, ConfgetError>where
Self: Sized,
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.