pub struct InlineTable { /* private fields */ }Implementations§
Source§impl InlineTable
Constructors
impl InlineTable
Constructors
See also FromIterator
Sourcepub fn into_table(self) -> Table
pub fn into_table(self) -> Table
Convert to a table
Source§impl InlineTable
Formatting
impl InlineTable
Formatting
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 sort_values(&mut self)
pub fn sort_values(&mut self)
Sourcepub fn sort_values_by<F>(&mut self, compare: F)
pub fn sort_values_by<F>(&mut self, compare: F)
Sourcepub fn set_dotted(&mut self, yes: bool)
pub fn set_dotted(&mut self, yes: bool)
Change this table’s dotted status
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 key_mut(&mut self, key: &str) -> Option<KeyMut<'_>>
pub fn key_mut(&mut self, key: &str) -> Option<KeyMut<'_>>
Returns an accessor to a key’s formatting
Sourcepub fn set_preamble(&mut self, preamble: impl Into<RawString>)
pub fn set_preamble(&mut self, preamble: impl Into<RawString>)
Set whitespace after before element
Source§impl InlineTable
impl InlineTable
Sourcepub fn iter(&self) -> InlineTableIter<'_>
pub fn iter(&self) -> InlineTableIter<'_>
Returns an iterator over key/value pairs.
Sourcepub fn iter_mut(&mut self) -> InlineTableIterMut<'_>
pub fn iter_mut(&mut self) -> InlineTableIterMut<'_>
Returns an iterator over key/value pairs.
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clears the table, removing all key-value pairs. Keeps the allocated memory for reuse.
Sourcepub fn entry(&mut self, key: impl Into<String>) -> InlineEntry<'_>
pub fn entry(&mut self, key: impl Into<String>) -> InlineEntry<'_>
Gets the given key’s corresponding entry in the Table for in-place manipulation.
Sourcepub fn entry_format<'a>(&'a mut self, key: &Key) -> InlineEntry<'a>
pub fn entry_format<'a>(&'a mut self, key: &Key) -> InlineEntry<'a>
Gets the given key’s corresponding entry in the Table for in-place manipulation.
Sourcepub fn get(&self, key: &str) -> Option<&Value>
pub fn get(&self, key: &str) -> Option<&Value>
Return an optional reference to the value at the given the key.
Sourcepub fn get_mut(&mut self, key: &str) -> Option<&mut Value>
pub fn get_mut(&mut self, key: &str) -> Option<&mut Value>
Return an optional mutable reference to the value at the 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 get_key_value_mut<'a>(
&'a mut self,
key: &str,
) -> Option<(KeyMut<'a>, &'a mut Item)>
pub fn get_key_value_mut<'a>( &'a mut self, key: &str, ) -> Option<(KeyMut<'a>, &'a mut Item)>
Return mutable 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 given key.
Sourcepub fn get_or_insert<V: Into<Value>>(
&mut self,
key: impl Into<String>,
value: V,
) -> &mut Value
pub fn get_or_insert<V: Into<Value>>( &mut self, key: impl Into<String>, value: V, ) -> &mut Value
Inserts a key/value pair if the table does not contain the key. Returns a mutable reference to the corresponding value.
Sourcepub fn insert(&mut self, key: impl Into<String>, value: Value) -> Option<Value>
pub fn insert(&mut self, key: impl Into<String>, value: Value) -> Option<Value>
Inserts a key-value pair into the map.
Sourcepub fn insert_formatted(&mut self, key: &Key, value: Value) -> Option<Value>
pub fn insert_formatted(&mut self, key: &Key, value: Value) -> Option<Value>
Inserts a key-value pair into the map.
Trait Implementations§
Source§impl Clone for InlineTable
impl Clone for InlineTable
Source§fn clone(&self) -> InlineTable
fn clone(&self) -> InlineTable
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InlineTable
impl Debug for InlineTable
Source§impl Default for InlineTable
impl Default for InlineTable
Source§fn default() -> InlineTable
fn default() -> InlineTable
Source§impl<K: Into<Key>, V: Into<Value>> Extend<(K, V)> for InlineTable
impl<K: Into<Key>, V: Into<Value>> Extend<(K, V)> for InlineTable
Source§fn extend<T: IntoIterator<Item = (K, V)>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = (K, V)>>(&mut self, iter: T)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)