[−][src]Struct justconfig::sources::text::ConfigText
Implements the text configuration parser.
Implementations
impl ConfigText
[src]
pub fn new(
conf_source: impl Read,
source_name: &str
) -> Result<Box<Self>, Error>
[src]
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.
pub fn with_path(
conf_source: impl Read,
source_name: &str,
path_root: &ConfPath
) -> Result<Box<Self>, Error>
[src]
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
impl Source for ConfigText
[src]
pub fn get(&self, key: ConfPath) -> Option<StringItem>
[src]
Auto Trait Implementations
impl !RefUnwindSafe for ConfigText
[src]
impl !Send for ConfigText
[src]
impl !Sync for ConfigText
[src]
impl Unpin for ConfigText
[src]
impl !UnwindSafe for ConfigText
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,