pub struct Configuration {}
Implementations§
Source§impl Configuration
impl Configuration
Sourcepub fn get<'a>(
&self,
_name: &str,
default_value: Option<&'a str>,
) -> Option<&'a str>
pub fn get<'a>( &self, _name: &str, default_value: Option<&'a str>, ) -> Option<&'a str>
Get the value of the name
property, None
if
no such property exists. If the key is deprecated, it returns the value of
the first key which replaces the deprecated key and is not None
.
Values are processed for [variable expansion
]
before being returned.
As a side effect get loads the properties from the sources if called for the first time as a lazy init.
Sourcepub fn get_trimmed<'a>(&self, name: &str) -> Option<&'a str>
pub fn get_trimmed<'a>(&self, name: &str) -> Option<&'a str>
Get the value of the name
property as a trimmed &str
,
None
if no such property exists.
If the key is deprecated, it returns the value of
the first key which replaces the deprecated key and is not None
Values are processed for [variable expansion
]
before being returned.
Sourcepub fn get_trimmed_with_default<'a>(
&self,
name: &str,
default_value: &'a str,
) -> &'a str
pub fn get_trimmed_with_default<'a>( &self, name: &str, default_value: &'a str, ) -> &'a str
Get the value of the name
property as a trimmed &str
,
default_value
if no such property exists.
See Configuration::get_trimmed
for more details.
Sourcepub fn get_int(&self, name: &str, default_value: i32) -> Result<i32>
pub fn get_int(&self, name: &str, default_value: i32) -> Result<i32>
Get the value of the name
property as an i32
.
If no such property exists, the provided default value is returned,
or if the specified value is not a valid i32
,
then an error is thrown.
Trait Implementations§
Source§impl Clone for Configuration
impl Clone for Configuration
Source§fn clone(&self) -> Configuration
fn clone(&self) -> Configuration
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more