Enum config::Value
[−]
[src]
pub enum Value { Nil, String(String), Integer(i64), Float(f64), Boolean(bool), Table(HashMap<String, Value>), Array(Vec<Value>), }
A configuration value.
Has an underlying or native type that comes from the configuration source but will be coerced into the requested type.
Variants
Nil
String(String)
Integer(i64)
Float(f64)
Boolean(bool)
Table(HashMap<String, Value>)
Array(Vec<Value>)
Methods
impl Value
[src]
fn as_str<'a>(&'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.
fn as_map(&self) -> Option<&HashMap<String, Value>>
Gets the underlying type as a map; only works if the type is actually a map.
fn as_slice(&self) -> Option<&[Value]>
Gets the underlying type as a slice; only works if the type is actually a slice.
Trait Implementations
impl Debug for Value
[src]
impl Clone for Value
[src]
fn clone(&self) -> Value
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
impl PartialEq for Value
[src]
fn eq(&self, __arg_0: &Value) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Value) -> bool
This method tests for !=
.