Enum config::Value
[−]
[src]
pub enum Value<'a> { String(Cow<'a, str>), Integer(i64), Float(f64), Boolean(bool), Table(HashMap<String, Value<'a>>), Array(Vec<Value<'a>>), }
A configuration value.
Has an underlying or native type that comes from the configuration source but will be coerced into the requested type.
Variants
String(Cow<'a, str>)
Integer(i64)
Float(f64)
Boolean(bool)
Table(HashMap<String, Value<'a>>)
Array(Vec<Value<'a>>)
Methods
impl<'a> Value<'a>
[src]
fn as_str(&'a self) -> Option<Cow<'a, str>>
Gets the underlying value as a string, performing a conversion only if neccessary.
fn as_bool(&self) -> Option<bool>
Gets the underlying type as a boolean, performing a conversion only if neccessary.
fn as_int(&self) -> Option<i64>
Gets the underlying type as an integer, performing a conversion only if neccessary.
fn as_float(&self) -> Option<f64>
Gets the underlying type as a floating-point, performing a conversion only if neccessary.
Trait Implementations
impl<'a> Debug for Value<'a>
[src]
impl<'a> Clone for Value<'a>
[src]
fn clone(&self) -> Value<'a>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more