Skip to main content

Merge

Trait Merge 

Source
pub trait Merge {
    // Required method
    fn merge(self, other: Self) -> Self;
}
Expand description

Trait for merging configuration values.

Convention: other takes precedence over self. For Option types, other wins if Some, otherwise falls back to self.

Required Methods§

Source

fn merge(self, other: Self) -> 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 bool

Source§

fn merge(self, other: Self) -> Self

Source§

impl Merge for char

Source§

fn merge(self, other: Self) -> Self

Source§

impl Merge for f32

Source§

fn merge(self, other: Self) -> Self

Source§

impl Merge for f64

Source§

fn merge(self, other: Self) -> Self

Source§

impl Merge for i8

Source§

fn merge(self, other: Self) -> Self

Source§

impl Merge for i16

Source§

fn merge(self, other: Self) -> Self

Source§

impl Merge for i32

Source§

fn merge(self, other: Self) -> Self

Source§

impl Merge for i64

Source§

fn merge(self, other: Self) -> Self

Source§

impl Merge for i128

Source§

fn merge(self, other: Self) -> Self

Source§

impl Merge for isize

Source§

fn merge(self, other: Self) -> Self

Source§

impl Merge for u8

Source§

fn merge(self, other: Self) -> Self

Source§

impl Merge for u16

Source§

fn merge(self, other: Self) -> Self

Source§

impl Merge for u32

Source§

fn merge(self, other: Self) -> Self

Source§

impl Merge for u64

Source§

fn merge(self, other: Self) -> Self

Source§

impl Merge for u128

Source§

fn merge(self, other: Self) -> Self

Source§

impl Merge for usize

Source§

fn merge(self, other: Self) -> Self

Source§

impl Merge for String

Source§

fn merge(self, other: Self) -> Self

Source§

impl Merge for PathBuf

Source§

fn merge(self, other: Self) -> Self

Source§

impl<K: Eq + Hash, V> Merge for HashMap<K, V>

Source§

fn merge(self, other: Self) -> Self

HashMaps: other’s keys override self’s

Source§

impl<K: Ord, V> Merge for BTreeMap<K, V>

Source§

fn merge(self, other: Self) -> Self

BTreeMaps: other’s keys override self’s

Source§

impl<T> Merge for Vec<T>

Source§

fn merge(self, other: Self) -> Self

Vectors: other replaces self entirely (not appended)

Source§

impl<T: Eq + Hash> Merge for HashSet<T>

Source§

fn merge(self, other: Self) -> Self

HashSets: union

Source§

impl<T: Ord> Merge for BTreeSet<T>

Source§

fn merge(self, other: Self) -> Self

BTreeSets: union

Source§

impl<T: Merge> Merge for Option<T>

Source§

fn merge(self, other: Self) -> Self

Implementors§