[−][src]Enum toml_edit::Value
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.
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.
Methods
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]
fn from(table: InlineTable) -> Self[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]
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = (K, V)>, [src]
I: IntoIterator<Item = (K, V)>,
impl<V: Into<Value>> FromIterator<V> for Value[src]
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = V>, [src]
I: IntoIterator<Item = V>,
impl FromStr 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> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
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>,