Skip to main content

ImDocument

Type Alias ImDocument 

Source
pub type ImDocument<S> = Document<S>;
👎Deprecated since 0.23.0:

Replaced with Document

Expand description

Type representing a parsed TOML document

Aliased Type§

pub struct ImDocument<S> { /* private fields */ }

Methods from Deref<Target = Table>§

Source

pub fn get_values(&self) -> Vec<(Vec<&Key>, &Value)>

Get key/values for values that are visually children of this table

For example, this will return dotted keys

Source

pub fn is_implicit(&self) -> bool

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

Source

pub fn is_dotted(&self) -> bool

Check if this is a wrapper for dotted keys, rather than a standard table

Source

pub fn position(&self) -> Option<isize>

The position of the Table within the DocumentMut.

Returns None if the Table was created manually (i.e. not via parsing) in which case its position is set automatically. This can be overridden with Table::set_position.

Source

pub fn decor(&self) -> &Decor

Returns the decor associated with a given key of the table.

Source

pub fn key(&self, key: &str) -> Option<&Key>

Returns an accessor to a key’s formatting

Source

pub fn span(&self) -> Option<Range<usize>>

The location within the original document

This generally requires a Document.

Source

pub fn iter(&self) -> Iter<'_>

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

Source

pub fn len(&self) -> usize

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

Source

pub fn is_empty(&self) -> bool

Returns true if the table is empty.

Source

pub fn get<'a>(&'a self, key: &str) -> Option<&'a Item>

Returns an optional reference to an item given the key.

Source

pub fn get_key_value<'a>(&'a self, key: &str) -> Option<(&'a Key, &'a Item)>

Return references to the key-value pair stored for key, if it is present, else None.

Source

pub fn contains_key(&self, key: &str) -> bool

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

Source

pub fn contains_table(&self, key: &str) -> bool

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

Source

pub fn contains_value(&self, key: &str) -> bool

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

Source

pub fn contains_array_of_tables(&self, key: &str) -> bool

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