[−][src]Enum cfg_lib::config::Value
This represents a value in a configuration.
Variants
Base(ScalarValue)These are the scalar values.
This is a list of values.
This is a mapping of strings to values.
Config(Config)This is a nested (sub-) configuration.
Methods
impl Value[src]
pub fn as_string(&self) -> String[src]
Expect a value to be a string and return it. Panic if it's not the expected type.
pub fn as_i64(&self) -> i64[src]
Expect a value to be an integer and return it. Panic if it's not the expected type.
pub fn as_f64(&self) -> f64[src]
Expect a value to be a floating-point value and return it. Panic if it's not the expected type.
pub fn as_c64(&self) -> Complex64[src]
Expect a value to be a complex number and return it. Panic if it's not the expected type.
pub fn as_bool(&self) -> bool[src]
Expect a value to be a Boolean and return it. Panic if it's not the expected type.
pub fn as_date(&self) -> NaiveDate[src]
Expect a value to be a date and return it. Panic if it's not the expected type.
pub fn as_datetime(&self) -> DateTime<FixedOffset>[src]
Expect a value to be a date/time and return it. Panic if it's not the expected type.
pub fn as_list(&self) -> Vec<Value>[src]
Expect a value to be a list and return it. Panic if it's not the expected type.
pub fn as_mapping(&self) -> HashMap<String, Value>[src]
Expect a value to be a mapping and return it. Panic if it's not the expected type.
pub fn as_config(&self) -> Config[src]
Expect a value to be a sub-configuration and return it. Panic if it's not the expected type.
Trait Implementations
impl Clone for Value[src]
impl Debug for Value[src]
impl<'_> From<&'_ str> for Value[src]
impl From<Complex<f64>> for Value[src]
impl From<DateTime<FixedOffset>> for Value[src]
fn from(value: DateTime<FixedOffset>) -> Self[src]
impl From<NaiveDate> for Value[src]
impl From<String> for Value[src]
impl From<bool> for Value[src]
impl From<f64> for Value[src]
impl From<i64> for Value[src]
impl PartialEq<Value> for Value[src]
impl StructuralPartialEq for Value[src]
impl TryInto<Complex<f64>> for Value[src]
type Error = &'static str
The type returned in the event of a conversion error.
fn try_into(self) -> StdResult<Complex64, Self::Error>[src]
impl TryInto<DateTime<FixedOffset>> for Value[src]
type Error = &'static str
The type returned in the event of a conversion error.
fn try_into(self) -> StdResult<DateTime<FixedOffset>, Self::Error>[src]
impl TryInto<NaiveDate> for Value[src]
type Error = &'static str
The type returned in the event of a conversion error.
fn try_into(self) -> StdResult<NaiveDate, Self::Error>[src]
impl TryInto<String> for Value[src]
type Error = &'static str
The type returned in the event of a conversion error.
fn try_into(self) -> StdResult<String, Self::Error>[src]
impl TryInto<f64> for Value[src]
type Error = &'static str
The type returned in the event of a conversion error.
fn try_into(self) -> StdResult<f64, Self::Error>[src]
impl TryInto<i64> for Value[src]
Auto Trait Implementations
impl !RefUnwindSafe for Value
impl !Send for Value
impl !Sync for Value
impl Unpin for Value
impl !UnwindSafe for Value
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,
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> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
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.
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>,