[][src]Struct justconfig::sources::text::ConfigText

pub struct ConfigText { /* fields omitted */ }

Implements the text configuration parser.

Implementations

impl ConfigText[src]

pub fn new(
    conf_source: impl Read,
    source_name: &str
) -> Result<Box<Self>, Error>
[src]

Parses a text representation into configuration information.

Any instance of a struct implementing Read can be passed to the configuration parser. As the second parameter a string identifying the configuration source must be passed. This string is used to construct the error location when displaying error messages.

The method returns a new ConfigText instance or an error if the file could not be parsed.

pub fn with_path(
    conf_source: impl Read,
    source_name: &str,
    path_root: &ConfPath
) -> Result<Box<Self>, Error>
[src]

Parse a text representation of configuration information and fill a ConfPath with the contained keys.

To be able to enumerate the keys of a configuration the children method of a ConfPath instance must be used. This variant of the new method allows a ConfPath instance to be passed. This instance is used to construct all configuration paths while parsing the text representation. After this method returns the ConfPath instance can be used to explore the contents of the parsed text configuration.

Trait Implementations

impl Source for ConfigText[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.