SourceFormat

Trait SourceFormat 

Source
pub trait SourceFormat<T: DeserializeOwned> {
    // Required methods
    fn should_parse(&self, source: &Source) -> bool;
    fn parse(
        &self,
        source: &Source,
        content: &str,
        cache_path: Option<&Path>,
    ) -> Result<T, ConfigError>;
}
Expand description

Parses a source into a specific format.

Required Methods§

Source

fn should_parse(&self, source: &Source) -> bool

Should this instance parse the provided source?

Source

fn parse( &self, source: &Source, content: &str, cache_path: Option<&Path>, ) -> Result<T, ConfigError>

Parse the source contents and return the deserialized value.

Implementors§