Struct justconfig::sources::text::ConfigText
source · [−]pub struct ConfigText { /* private fields */ }
Expand description
Implements the text configuration parser.
Implementations
sourceimpl ConfigText
impl ConfigText
sourcepub fn new(
conf_source: impl Read,
source_name: &str
) -> Result<Box<Self>, Error>
pub fn new(
conf_source: impl Read,
source_name: &str
) -> Result<Box<Self>, Error>
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.
sourcepub fn with_path(
conf_source: impl Read,
source_name: &str,
path_root: &ConfPath
) -> Result<Box<Self>, Error>
pub fn with_path(
conf_source: impl Read,
source_name: &str,
path_root: &ConfPath
) -> Result<Box<Self>, Error>
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
sourceimpl Source for ConfigText
impl Source for ConfigText
Auto Trait Implementations
impl !RefUnwindSafe for ConfigText
impl !Send for ConfigText
impl !Sync for ConfigText
impl Unpin for ConfigText
impl !UnwindSafe for ConfigText
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more