Struct toml_edit::Table[][src]

pub struct Table { /* fields omitted */ }

Type representing a TOML non-inline table

Methods

impl Table
[src]

Creates an empty table.

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

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

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

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

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

Removes an item given the key.

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

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

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

Returns true iff the table is empty.

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.

Returns an optional reference to an item given the key.

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]

Formats the value using the given formatter. Read more

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

The returned type after indexing.

Performs the indexing (container[index]) operation.

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

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

impl Clone for Table
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Table
[src]

Formats the value using the given formatter. Read more

impl Default for Table
[src]

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

impl TableLike for Table
[src]

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

Returns an optional reference to an item given the key.

Returns the number of nonempty items.

Returns true iff the table is empty.

Auto Trait Implementations

impl Send for Table

impl Sync for Table