bdk_core

Trait Merge

Source
pub trait Merge: Default {
    // Required methods
    fn merge(&mut self, other: Self);
    fn is_empty(&self) -> bool;

    // Provided method
    fn take(&mut self) -> Option<Self> { ... }
}
Expand description

Trait that makes an object mergeable.

Required Methods§

Source

fn merge(&mut self, other: Self)

Merge another object of the same type onto self.

Source

fn is_empty(&self) -> bool

Returns whether the structure is considered empty.

Provided Methods§

Source

fn take(&mut self) -> Option<Self>

Take the value, replacing it with the default value.

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 ()

Source§

fn merge(&mut self, _other: Self)

Source§

fn is_empty(&self) -> bool

Source§

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

Source§

fn merge(&mut self, other: Self)

Source§

fn is_empty(&self) -> bool

Source§

impl<T0> Merge for (T0,)
where T0: Merge,

Source§

fn merge(&mut self, _other: Self)

Source§

fn is_empty(&self) -> bool

Source§

impl<T0, T1> Merge for (T0, T1)
where T0: Merge, T1: Merge,

Source§

fn merge(&mut self, _other: Self)

Source§

fn is_empty(&self) -> bool

Source§

impl<T0, T1, T2> Merge for (T0, T1, T2)
where T0: Merge, T1: Merge, T2: Merge,

Source§

fn merge(&mut self, _other: Self)

Source§

fn is_empty(&self) -> bool

Source§

impl<T0, T1, T2, T3> Merge for (T0, T1, T2, T3)
where T0: Merge, T1: Merge, T2: Merge, T3: Merge,

Source§

fn merge(&mut self, _other: Self)

Source§

fn is_empty(&self) -> bool

Source§

impl<T0, T1, T2, T3, T4> Merge for (T0, T1, T2, T3, T4)
where T0: Merge, T1: Merge, T2: Merge, T3: Merge, T4: Merge,

Source§

fn merge(&mut self, _other: Self)

Source§

fn is_empty(&self) -> bool

Source§

impl<T0, T1, T2, T3, T4, T5> Merge for (T0, T1, T2, T3, T4, T5)
where T0: Merge, T1: Merge, T2: Merge, T3: Merge, T4: Merge, T5: Merge,

Source§

fn merge(&mut self, _other: Self)

Source§

fn is_empty(&self) -> bool

Source§

impl<T0, T1, T2, T3, T4, T5, T6> Merge for (T0, T1, T2, T3, T4, T5, T6)
where T0: Merge, T1: Merge, T2: Merge, T3: Merge, T4: Merge, T5: Merge, T6: Merge,

Source§

fn merge(&mut self, _other: Self)

Source§

fn is_empty(&self) -> bool

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7> Merge for (T0, T1, T2, T3, T4, T5, T6, T7)
where T0: Merge, T1: Merge, T2: Merge, T3: Merge, T4: Merge, T5: Merge, T6: Merge, T7: Merge,

Source§

fn merge(&mut self, _other: Self)

Source§

fn is_empty(&self) -> bool

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8> Merge for (T0, T1, T2, T3, T4, T5, T6, T7, T8)
where T0: Merge, T1: Merge, T2: Merge, T3: Merge, T4: Merge, T5: Merge, T6: Merge, T7: Merge, T8: Merge,

Source§

fn merge(&mut self, _other: Self)

Source§

fn is_empty(&self) -> bool

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> Merge for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)
where T0: Merge, T1: Merge, T2: Merge, T3: Merge, T4: Merge, T5: Merge, T6: Merge, T7: Merge, T8: Merge, T9: Merge,

Source§

fn merge(&mut self, _other: Self)

Source§

fn is_empty(&self) -> bool

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Merge for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)
where T0: Merge, T1: Merge, T2: Merge, T3: Merge, T4: Merge, T5: Merge, T6: Merge, T7: Merge, T8: Merge, T9: Merge, T10: Merge,

Source§

fn merge(&mut self, _other: Self)

Source§

fn is_empty(&self) -> bool

Source§

impl<T> Merge for Vec<T>

Source§

fn merge(&mut self, other: Self)

Source§

fn is_empty(&self) -> bool

Source§

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

Source§

fn merge(&mut self, other: Self)

Source§

fn is_empty(&self) -> bool

Implementors§