[][src]Struct toml_edit::InlineTable

pub struct InlineTable { /* fields omitted */ }

Type representing a TOML inline table, payload of the Value::InlineTable variant

Methods

impl InlineTable[src]

pub fn len(&self) -> usize[src]

Returns the number of key/value pairs.

pub fn is_empty(&self) -> bool[src]

Returns true iff the table is empty.

pub fn iter(&self) -> Box<dyn Iterator<Item = (&'a str, &'a Value)> + 'a>[src]

Returns an iterator over key/value pairs.

pub fn sort(&mut self)[src]

Sorts the key/value pairs by key.

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

Returns true iff the table contains given key.

pub fn merge_into(&mut self, other: &mut InlineTable)[src]

Merges the key/value pairs into the other table leaving self empty.

pub fn get_or_insert<V: Into<Value>>(
    &mut self,
    key: &str,
    value: V
) -> &mut Value
[src]

Inserts a key/value pair if the table does not contain the key. Returns a mutable reference to the corresponding value.

pub fn fmt(&mut self)[src]

Auto formats the table.

pub fn remove(&mut self, key: &str) -> Option<Value>[src]

Removes a key/value pair given the key.

pub fn get(&self, key: &str) -> Option<&Value>[src]

Return an optional reference to the value at the given the key.

pub fn get_mut(&mut self, key: &str) -> Option<&mut Value>[src]

Return an optional mutable reference to the value at the given the key.

Trait Implementations

impl TableLike for InlineTable[src]

fn len(&self) -> usize[src]

Returns the number of nonempty items.

fn is_empty(&self) -> bool[src]

Returns true iff the table is empty.

impl Default for InlineTable[src]

impl From<InlineTable> for Value[src]

impl Clone for InlineTable[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for InlineTable[src]

impl Display for InlineTable[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]