[][src]Enum toml_edit::Value

pub enum Value {
    Integer(Formatted<i64>),
    String(Formatted<String>),
    Float(Formatted<f64>),
    DateTime(Formatted<DateTime>),
    Boolean(Formatted<bool>),
    Array(Array),
    InlineTable(InlineTable),
}

Representation of a TOML Value (as part of a Key/Value Pair).

Variants

Integer(Formatted<i64>)

A 64-bit integer value.

String(Formatted<String>)

A string value.

Float(Formatted<f64>)

A 64-bit float value.

DateTime(Formatted<DateTime>)

A Date-Time value.

Boolean(Formatted<bool>)

A boolean value.

Array(Array)

An inline array of values.

InlineTable(InlineTable)

An inline table of key/value pairs.

Implementations

impl Value[src]

Downcasting

pub fn as_integer(&self) -> Option<i64>[src]

Casts self to integer.

pub fn is_integer(&self) -> bool[src]

Returns true iff self is an integer.

pub fn as_float(&self) -> Option<f64>[src]

Casts self to float.

pub fn is_float(&self) -> bool[src]

Returns true iff self is a float.

pub fn as_bool(&self) -> Option<bool>[src]

Casts self to boolean.

pub fn is_bool(&self) -> bool[src]

Returns true iff self is a boolean.

pub fn as_str(&self) -> Option<&str>[src]

Casts self to str.

pub fn is_str(&self) -> bool[src]

Returns true iff self is a string.

pub fn as_date_time(&self) -> Option<&DateTime>[src]

Casts self to date-time.

pub fn is_date_time(&self) -> bool[src]

Returns true iff self is a date-time.

pub fn as_array(&self) -> Option<&Array>[src]

Casts self to array.

pub fn as_array_mut(&mut self) -> Option<&mut Array>[src]

Casts self to mutable array.

pub fn is_array(&self) -> bool[src]

Returns true iff self is an array.

pub fn as_inline_table(&self) -> Option<&InlineTable>[src]

Casts self to inline table.

pub fn as_inline_table_mut(&mut self) -> Option<&mut InlineTable>[src]

Casts self to mutable inline table.

pub fn is_inline_table(&self) -> bool[src]

Returns true iff self is an inline table.

impl Value[src]

pub fn decor(&self) -> &Decor[src]

Get the decoration of the value.

Example

let v = toml_edit::Value::from(true);
assert_eq!(v.decor().suffix(), "");

Trait Implementations

impl Clone for Value[src]

impl Debug for Value[src]

impl Display for Value[src]

impl<'b> From<&'b str> for Value[src]

impl From<Array> for Value[src]

impl From<InlineTable> 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<'k, K: Into<&'k Key>, V: Into<Value>> FromIterator<(K, V)> for Value[src]

impl<V: Into<Value>> FromIterator<V> for Value[src]

impl FromStr for Value[src]

type Err = TomlError

The associated error which can be returned from parsing.

fn from_str(s: &str) -> Result<Self, Self::Err>[src]

Parses a value from a &str

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.