[][src]Trait justconfig::processors::Explode

pub trait Explode where
    Self: Sized
{ pub fn explode(self, delimiter: char) -> Result<StringItem, ConfigError>; }

Splits a character delimited config value into multiple configuration values.

Required methods

pub fn explode(self, delimiter: char) -> Result<StringItem, ConfigError>[src]

Loading content...

Implementations on Foreign Types

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

pub fn explode(self, delimiter: char) -> Result<StringItem, ConfigError>[src]

Call this method on the configuration pipeline to split a config value into multiple values.

The passed delimiter is used as a separator for the configuration values.

Example

defaults.set(conf.root().push_all(&["splitme"]), "1,2,3", "source info");
conf.add_source(defaults);

let values: Vec<u32> = conf.get(ConfPath::from(&["splitme"])).explode(',').values(..).unwrap();

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

Implementors

Loading content...