TomlTableMutateExt

Trait TomlTableMutateExt 

Source
pub trait TomlTableMutateExt {
    // Required methods
    fn upsert(
        &mut self,
        _: &str,
        _: impl Serialize,
    ) -> Result<(), ConfigMutateError>;
    fn delete(&mut self, _: &str) -> Result<(), ConfigMutateError>;
}
Expand description

Extension trait for [toml::Table] to mutate values at a given dot-separated path.

Required Methods§

Source

fn upsert( &mut self, _: &str, _: impl Serialize, ) -> Result<(), ConfigMutateError>

Upsert a value at the given dot-separated path.

Returns an error if the path or the value is invalid.

Source

fn delete(&mut self, _: &str) -> Result<(), ConfigMutateError>

Delete a value at the given path.

Returns an error if the path is invalid.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl TomlTableMutateExt for Table

Source§

fn upsert( &mut self, path: &str, value: impl Serialize, ) -> Result<(), ConfigMutateError>

Source§

fn delete(&mut self, path: &str) -> Result<(), ConfigMutateError>

Implementors§