Enum toml_edit::Item [−][src]
pub enum Item { None, Value(Value), Table(Table), ArrayOfTables(ArrayOfTables), }
Type representing either a value, a table, an array of tables, or none.
Variants
None
Type representing none.
Value(Value)
Type representing value.
Table(Table)
Type representing table.
ArrayOfTables(ArrayOfTables)
Type representing array of tables.
Methods
impl Item
[src]
impl Item
pub fn or_insert(&mut self, item: Item) -> &mut Item
[src]
pub fn or_insert(&mut self, item: Item) -> &mut Item
Sets self
to the given item iff self
is none and
returns a mutable reference to self
.
impl Item
[src]
impl Item
Downcasting
pub fn as_value(&self) -> Option<&Value>
[src]
pub fn as_value(&self) -> Option<&Value>
Casts self
to value.
pub fn as_table(&self) -> Option<&Table>
[src]
pub fn as_table(&self) -> Option<&Table>
Casts self
to table.
pub fn as_array_of_tables(&self) -> Option<&ArrayOfTables>
[src]
pub fn as_array_of_tables(&self) -> Option<&ArrayOfTables>
Casts self
to array of tables.
pub fn as_value_mut(&mut self) -> Option<&mut Value>
[src]
pub fn as_value_mut(&mut self) -> Option<&mut Value>
Casts self
to mutable value.
pub fn as_table_mut(&mut self) -> Option<&mut Table>
[src]
pub fn as_table_mut(&mut self) -> Option<&mut Table>
Casts self
to mutable table.
pub fn as_array_of_tables_mut(&mut self) -> Option<&mut ArrayOfTables>
[src]
pub fn as_array_of_tables_mut(&mut self) -> Option<&mut ArrayOfTables>
Casts self
to mutable array of tables.
pub fn is_value(&self) -> bool
[src]
pub fn is_value(&self) -> bool
Returns true iff self
is a value.
pub fn is_table(&self) -> bool
[src]
pub fn is_table(&self) -> bool
Returns true iff self
is a table.
pub fn is_array_of_tables(&self) -> bool
[src]
pub fn is_array_of_tables(&self) -> bool
Returns true iff self
is an array of tables.
pub fn is_none(&self) -> bool
[src]
pub fn is_none(&self) -> bool
Returns true iff self
is None
.
pub fn as_integer(&self) -> Option<i64>
[src]
pub fn as_integer(&self) -> Option<i64>
Casts self
to integer.
pub fn is_integer(&self) -> bool
[src]
pub fn is_integer(&self) -> bool
Returns true iff self
is an integer.
pub fn as_float(&self) -> Option<f64>
[src]
pub fn as_float(&self) -> Option<f64>
Casts self
to float.
pub fn is_float(&self) -> bool
[src]
pub fn is_float(&self) -> bool
Returns true iff self
is a float.
pub fn as_bool(&self) -> Option<bool>
[src]
pub fn as_bool(&self) -> Option<bool>
Casts self
to boolean.
pub fn is_bool(&self) -> bool
[src]
pub fn is_bool(&self) -> bool
Returns true iff self
is a boolean.
pub fn as_str(&self) -> Option<&str>
[src]
pub fn as_str(&self) -> Option<&str>
Casts self
to str.
pub fn is_str(&self) -> bool
[src]
pub fn is_str(&self) -> bool
Returns true iff self
is a string.
pub fn as_date_time(&self) -> Option<&DateTime>
[src]
pub fn as_date_time(&self) -> Option<&DateTime>
Casts self
to date-time.
pub fn is_date_time(&self) -> bool
[src]
pub fn is_date_time(&self) -> bool
Returns true iff self
is a date-time.
pub fn as_array(&self) -> Option<&Array>
[src]
pub fn as_array(&self) -> Option<&Array>
Casts self
to array.
pub fn as_array_mut(&mut self) -> Option<&mut Array>
[src]
pub fn as_array_mut(&mut self) -> Option<&mut Array>
Casts self
to mutable array.
pub fn is_array(&self) -> bool
[src]
pub fn is_array(&self) -> bool
Returns true iff self
is an array.
pub fn as_inline_table(&self) -> Option<&InlineTable>
[src]
pub fn as_inline_table(&self) -> Option<&InlineTable>
Casts self
to inline table.
pub fn as_inline_table_mut(&mut self) -> Option<&mut InlineTable>
[src]
pub fn as_inline_table_mut(&mut self) -> Option<&mut InlineTable>
Casts self
to mutable inline table.
pub fn is_inline_table(&self) -> bool
[src]
pub fn is_inline_table(&self) -> bool
Returns true iff self
is an inline table.
pub fn as_table_like(&self) -> Option<&TableLike>
[src]
pub fn as_table_like(&self) -> Option<&TableLike>
Casts self
to either a table or an inline table.
pub fn is_table_like(&self) -> bool
[src]
pub fn is_table_like(&self) -> bool
Returns true iff self
is either a table, or an inline table.
Trait Implementations
impl<I> Index<I> for Item where
I: Index,
[src]
impl<I> Index<I> for Item where
I: Index,
type Output = Item
The returned type after indexing.
fn index(&self, index: I) -> &Item
[src]
fn index(&self, index: I) -> &Item
Performs the indexing (container[index]
) operation.
impl<I> IndexMut<I> for Item where
I: Index,
[src]
impl<I> IndexMut<I> for Item where
I: Index,
fn index_mut(&mut self, index: I) -> &mut Item
[src]
fn index_mut(&mut self, index: I) -> &mut Item
Performs the mutable indexing (container[index]
) operation.
impl Debug for Item
[src]
impl Debug for Item
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Item
[src]
impl Clone for Item
fn clone(&self) -> Item
[src]
fn clone(&self) -> Item
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Default for Item
[src]
impl Default for Item