[−][src]Enum toml_edit::Item
Type representing either a value, a table, an array of tables, or none.
Variants
Type representing none.
Value(Value)
Type representing value.
Table(Table)
Type representing table.
ArrayOfTables(ArrayOfTables)
Type representing array of tables.
Methods
impl Item
[src]
pub fn or_insert(&mut self, item: Item) -> &mut Item
[src]
Sets self
to the given item iff self
is none and
returns a mutable reference to self
.
impl Item
[src]
Downcasting
pub fn as_value(&self) -> Option<&Value>
[src]
Casts self
to value.
pub fn as_table(&self) -> Option<&Table>
[src]
Casts self
to table.
pub fn as_array_of_tables(&self) -> Option<&ArrayOfTables>
[src]
Casts self
to array of tables.
pub fn as_value_mut(&mut self) -> Option<&mut Value>
[src]
Casts self
to mutable value.
pub fn as_table_mut(&mut self) -> Option<&mut Table>
[src]
Casts self
to mutable table.
pub fn as_array_of_tables_mut(&mut self) -> Option<&mut ArrayOfTables>
[src]
Casts self
to mutable array of tables.
pub fn is_value(&self) -> bool
[src]
Returns true iff self
is a value.
pub fn is_table(&self) -> bool
[src]
Returns true iff self
is a table.
pub fn is_array_of_tables(&self) -> bool
[src]
Returns true iff self
is an array of tables.
pub fn is_none(&self) -> bool
[src]
Returns true iff self
is None
.
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.
pub fn as_table_like(&self) -> Option<&dyn TableLike>
[src]
Casts self
to either a table or an inline table.
pub fn is_table_like(&self) -> bool
[src]
Returns true iff self
is either a table, or an inline table.
Trait Implementations
impl Clone for Item
[src]
impl Debug for Item
[src]
impl Default for Item
[src]
impl<I> Index<I> for Item where
I: Index,
[src]
I: Index,
impl<I> IndexMut<I> for Item where
I: Index,
[src]
I: Index,
Auto Trait Implementations
impl RefUnwindSafe for Item
impl Send for Item
impl Sync for Item
impl Unpin for Item
impl UnwindSafe for Item
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>,