Merge

Trait Merge 

Source
pub trait Merge {
    // Required methods
    fn merge(&mut self, mergee: Self) -> Result<&mut Self, DataResolverError>;
    fn merge_at(
        &mut self,
        key: &str,
        mergee: Self,
    ) -> Result<&mut Self, DataResolverError>;
    fn take(&mut self) -> Self;
}
Expand description

Define methods for

  • merging one instance of a type into another instance of the same type
  • doing the above but instead under a specified key within the target instance
  • taking value from a mutable ref

Required Methods§

Source

fn merge(&mut self, mergee: Self) -> Result<&mut Self, DataResolverError>

Merge another instance into self, mutating self

Source

fn merge_at( &mut self, key: &str, mergee: Self, ) -> Result<&mut Self, DataResolverError>

Merge another instance into self at a specified key, mutating self

Source

fn take(&mut self) -> Self

Take ownership via mutable reference

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 Merge for Value

Source§

fn take(&mut self) -> Self

Returns owned serde_yaml::Value, leaving serde_yaml::Value::Null in its place.

Source§

fn merge(&mut self, mergee: Self) -> Result<&mut Self, DataResolverError>

Source§

fn merge_at( &mut self, key: &str, mergee: Self, ) -> Result<&mut Self, DataResolverError>

Implementors§