Struct toml_edit::Table [] [src]

pub struct Table { /* fields omitted */ }

Type representing a TOML non-inline table

Methods

impl Table
[src]

[src]

Creates an empty table.

[src]

Returns true iff the table contains an item with the given key.

[src]

Returns true iff the table contains a table with the given key.

[src]

Returns true iff the table contains a value with the given key.

[src]

Returns true iff the table contains an array of tables with the given key.

[src]

Returns an iterator over all key/value pairs, including empty.

[src]

Removes an item given the key.

[src]

Sorts Key/Value Pairs of the table, doesn't affect subtables or subarrays.

[src]

Returns the number of non-empty items in the table.

[src]

Returns the number of key/value pairs in the table.

[src]

Returns true iff the table is empty.

[src]

Given the key, return a mutable reference to the value. If there is no entry associated with the given key in the table, a Item::None value will be inserted.

To insert to table, use entry to return a mutable reference and set it to the appropriate value.

[src]

Returns an optional reference to an item given the key.

[src]

If a table has no key/value pairs and implicit, it will not be displayed.

Examples

[target."x86_64/windows.json".dependencies]

In the document above, tables target and target."x86_64/windows.json" are implicit.

let mut doc = "[a]\n[a.b]\n".parse::<Document>().expect("invalid toml");

doc["a"].as_table_mut().unwrap().set_implicit(true);
assert_eq!(doc.to_string(), "[a.b]\n");

Trait Implementations

impl Display for Table
[src]

[src]

Formats the value using the given formatter. Read more

impl Clone for Table
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Table
[src]

[src]

Formats the value using the given formatter.

impl Default for Table
[src]

[src]

Returns the "default value" for a type. Read more

impl TableLike for Table
[src]

[src]

Returns an iterator over all subitems, including Item::None.

[src]

Returns an optional reference to an item given the key.

[src]

Returns the number of nonempty items.

[src]

Returns true iff the table is empty.

impl<'s> Index<&'s str> for Table
[src]

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

impl<'s> IndexMut<&'s str> for Table
[src]

[src]

Performs the mutable indexing (container[index]) operation.