Trait salak::PropertySource[][src]

pub trait PropertySource: Sync + Send {
    fn name(&self) -> String;
fn get_property(&self, key: &str) -> Option<Property>;
fn is_empty(&self) -> bool;
fn get_keys(&self, prefix: &str) -> Vec<String>;
fn load(&self) -> Result<Option<Box<dyn PropertySource>>, PropertyError>; fn contains_property(&self, key: &str) -> bool { ... } }

An abstract source loader from various sources, such as command line arguments, system environment, files, etc.

Required methods

fn name(&self) -> String[src]

fn get_property(&self, key: &str) -> Option<Property>[src]

Get property by name.

fn is_empty(&self) -> bool[src]

Check whether the PropertySource is empty. Empty source will not be ignored when register to registry.

fn get_keys(&self, prefix: &str) -> Vec<String>[src]

Find all next level keys with prefix.

fn load(&self) -> Result<Option<Box<dyn PropertySource>>, PropertyError>[src]

Reload PropertySource, if this PropertySource not support reload, then just return Ok(None).

Loading content...

Provided methods

fn contains_property(&self, key: &str) -> bool[src]

Check whether property exists.

Loading content...

Implementors

Loading content...