[][src]Trait justconfig::processors::NotEmpty

pub trait NotEmpty where
    Self: Sized
{ pub fn not_empty(self) -> Result<StringItem, ConfigError>; }

Removes empty config values.

Required methods

Loading content...

Implementations on Foreign Types

impl NotEmpty for Result<StringItem, ConfigError>[src]

pub fn not_empty(self) -> Result<StringItem, ConfigError>[src]

Call this method to remove all empty configuration values from a configuration item.

Example

defaults.set(conf.root().push_all(&["myitem"]), "abc", "source info");
defaults.put(conf.root().push_all(&["myitem"]), "", "source info");
defaults.put(conf.root().push_all(&["myitem"]), "def", "source info");
conf.add_source(defaults);

let values: Vec<String> = conf.get(ConfPath::from(&["myitem"])).not_empty().values(..).unwrap();

assert_eq!(values.len(), 2);
assert_eq!(values[0], "abc");
assert_eq!(values[1], "def");
Loading content...

Implementors

Loading content...