Struct toml_edit::Array[][src]

pub struct Array { /* fields omitted */ }
Expand description

Type representing a TOML array, payload of the Value::Array variant’s value

Implementations

Returns the length of the underlying Vec. To get the actual number of items use a.iter().count().

Return true iff self.len() == 0.

Returns an iterator over all values.

Appends a new value to the end of the array, applying default formatting to it.

Returns an error if the value was of a different type than the values in the array.

Appends a new, already formatted value to the end of the array.

Returns an error if the value was of a different type than the array.

Inserts an element at the given position within the array, applying default formatting to it and shifting all values after it to the right.

Returns an error if the value was of a different type than the values in the array.

Panics if index > len.

Inserts an already formatted value at the given position within the array, shifting all values after it to the right.

Returns an error if the value was of a different type than the values in the array.

Panics if index > len.

Replaces the element at the given position within the array, preserving existing formatting.

Returns an error if the replacement was of a different type than the values in the array.

Panics if index >= len.

Replaces the element at the given position within the array with an already formatted value.

Returns an error if the replacement was of a different type than the values in the array.

Panics if index >= len.

Returns a reference to the value at the given index, or None if the index is out of bounds.

Removes the value at the given index.

Auto formats the array.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.