Struct iron_config::IC
[−]
pub struct IC { /* fields omitted */ }
Methods from __Deref<Target = Value>
fn try_into<'de, T>(self) -> Result<T, Error> where
T: Deserialize<'de>,
T: Deserialize<'de>,
Interpret a toml::Value
as an instance of type T
.
This conversion can fail if the structure of the Value
does not match the
structure expected by T
, for example if T
is a struct type but the
Value
contains something other than a TOML table. It can also fail if the
structure is correct but T
's implementation of Deserialize
decides that
something is wrong with the data, for example required struct fields are
missing from the TOML map or some number is too big to fit in the expected
primitive type.
fn get<I>(&self, index: I) -> Option<&Value> where
I: Index,
I: Index,
Index into a TOML array or map. A string index can be used to access a value in a map, and a usize index can be used to access an element of an array.
Returns None
if the type of self
does not match the type of the
index, for example if the index is a string and self
is an array or a
number. Also returns None
if the given key does not exist in the map
or the given index is not within the bounds of the array.
fn as_integer(&self) -> Option<i64>
Extracts the integer value if it is an integer.
fn is_integer(&self) -> bool
Tests whether this value is an integer
fn as_float(&self) -> Option<f64>
Extracts the float value if it is a float.
fn is_float(&self) -> bool
Tests whether this value is a float
fn as_bool(&self) -> Option<bool>
Extracts the boolean value if it is a boolean.
fn is_bool(&self) -> bool
Tests whether this value is a boolean
fn as_str(&self) -> Option<&str>
Extracts the string of this value if it is a string.
fn is_str(&self) -> bool
Tests if this value is a string
fn as_datetime(&self) -> Option<&Datetime>
Extracts the datetime value if it is a datetime.
Note that a parsed TOML value will only contain ISO 8601 dates. An example date is:
1979-05-27T07:32:00Z
fn is_datetime(&self) -> bool
Tests whether this value is a datetime
fn as_array(&self) -> Option<&Vec<Value>>
Extracts the array value if it is an array.
fn is_array(&self) -> bool
Tests whether this value is an array
fn as_table(&self) -> Option<&BTreeMap<String, Value>>
Extracts the table value if it is a table.
fn is_table(&self) -> bool
Extracts the table value if it is a table.
fn same_type(&self, other: &Value) -> bool
Tests whether this and another value have the same type.
fn type_str(&self) -> &'static str
Returns a human-readable representation of the type of this value.
Trait Implementations
impl __Deref for IC
type Target = Value
The resulting type after dereferencing
fn deref(&self) -> &Value
The method called to dereference a value