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§
Sourcefn merge(&mut self, mergee: Self) -> Result<&mut Self, DataResolverError>
fn merge(&mut self, mergee: Self) -> Result<&mut Self, DataResolverError>
Merge another instance into self, mutating self
Sourcefn merge_at(
&mut self,
key: &str,
mergee: Self,
) -> Result<&mut Self, DataResolverError>
fn merge_at( &mut self, key: &str, mergee: Self, ) -> Result<&mut Self, DataResolverError>
Merge another instance into self at a specified key, mutating self
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
impl Merge for Value
Source§fn take(&mut self) -> Self
fn take(&mut self) -> Self
Returns owned serde_yaml::Value, leaving serde_yaml::Value::Null in its place.