[][src]Trait toml_query::delete::TomlValueDeleteExt

pub trait TomlValueDeleteExt {
    fn delete_with_seperator(
        &mut self,
        query: &str,
        sep: char
    ) -> Result<Option<Value>>; fn delete(&mut self, query: &str) -> Result<Option<Value>> { ... } }

Required methods

fn delete_with_seperator(
    &mut self,
    query: &str,
    sep: char
) -> Result<Option<Value>>

Extension function for deleting a value in the current toml::Value document using a custom seperator.

Semantics

The function does not delete non-empty data structures. So deleting array from

array = [ 1 ]

does not work.

Return value

If the delete operation worked correctly, Ok(Option<Value>) is returned.

The Option<Value> part is None if no value was actually removed as there was no value there. For example, if you're deleting table.a and the Table table has no key a, then Ok(None) is returned. Also, if you're deleting from an Array, but there is nothing in the array, or the array is shorter than the index you're deleting. If the delete operation actually removed something from the toml document, this value is returned as Ok(Some(Value)).

On failure, Err(e) is returned

Loading content...

Provided methods

fn delete(&mut self, query: &str) -> Result<Option<Value>>

Extension function for deleting a value from the current toml::Value document

See documentation of TomlValueDeleteExt::delete_with_seperator

Loading content...

Implementations on Foreign Types

impl TomlValueDeleteExt for Value[src]

Loading content...

Implementors

Loading content...