Trait toml_query::set::TomlValueSetExt [] [src]

pub trait TomlValueSetExt {
    fn set_with_seperator(
        &mut self,
        query: &str,
        sep: char,
        value: Value
    ) -> Result<Option<Value>>; fn set(&mut self, query: &str, value: Value) -> Result<Option<Value>> { ... } }

Required Methods

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

Semantics

The function never creates intermediate data structures (Tables or Arrays) in the document.

Return value

  • If the set operation worked correctly, Ok(None) is returned.
  • If the set operation replaced an existing value Ok(Some(old_value)) is returned
  • On failure, Err(e) is returned:
    • If the query is "a.b.c" but there is no table "b": error
    • If the query is "a.b.[0]" but "b" is not an array: error
    • If the query is "a.b.[3]" but the array at "b" has no index 3: error
    • etc.

Provided Methods

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

See documentation of TomlValueSetExt::set_with_seperator

Implementations on Foreign Types

impl TomlValueSetExt for Value
[src]

[src]

[src]

Implementors