pub struct Document<S> { /* private fields */ }Implementations§
Source§impl<S: AsRef<str>> Document<S>
impl<S: AsRef<str>> Document<S>
Sourcepub fn into_mut(self) -> DocumentMut
pub fn into_mut(self) -> DocumentMut
Allow editing of the DocumentMut
Methods from Deref<Target = Table>§
Sourcepub fn get_values(&self) -> Vec<(Vec<&Key>, &Value)>
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
Sourcepub fn is_implicit(&self) -> bool
pub fn is_implicit(&self) -> bool
If a table has no key/value pairs and implicit, it will not be displayed.
Sourcepub fn is_dotted(&self) -> bool
pub fn is_dotted(&self) -> bool
Check if this is a wrapper for dotted keys, rather than a standard table
Sourcepub fn position(&self) -> Option<isize>
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.
Sourcepub fn span(&self) -> Option<Range<usize>>
pub fn span(&self) -> Option<Range<usize>>
The location within the original document
This generally requires a Document.
Sourcepub fn get<'a>(&'a self, key: &str) -> Option<&'a Item>
pub fn get<'a>(&'a self, key: &str) -> Option<&'a Item>
Returns an optional reference to an item given the key.
Sourcepub fn get_key_value<'a>(&'a self, key: &str) -> Option<(&'a Key, &'a Item)>
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.
Sourcepub fn contains_key(&self, key: &str) -> bool
pub fn contains_key(&self, key: &str) -> bool
Returns true if the table contains an item with the given key.
Sourcepub fn contains_table(&self, key: &str) -> bool
pub fn contains_table(&self, key: &str) -> bool
Returns true if the table contains a table with the given key.
Sourcepub fn contains_value(&self, key: &str) -> bool
pub fn contains_value(&self, key: &str) -> bool
Returns true if the table contains a value with the given key.
Sourcepub fn contains_array_of_tables(&self, key: &str) -> bool
pub fn contains_array_of_tables(&self, key: &str) -> bool
Returns true if the table contains an array of tables with the given key.