bdk_chain

Trait Merge

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§

fn merge(&mut self, other: Self)

Merge another object of the same type onto self.

fn is_empty(&self) -> bool

Returns whether the structure is considered empty.

Provided Methods§

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§

§

impl Merge for ()

§

fn merge(&mut self, _other: ())

§

fn is_empty(&self) -> bool

§

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

§

fn merge(&mut self, other: BTreeMap<K, V>)

§

fn is_empty(&self) -> bool

§

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

§

fn merge(&mut self, _other: (T0,))

§

fn is_empty(&self) -> bool

§

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

§

fn merge(&mut self, _other: (T0, T1))

§

fn is_empty(&self) -> bool

§

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

§

fn merge(&mut self, _other: (T0, T1, T2))

§

fn is_empty(&self) -> bool

§

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

§

fn merge(&mut self, _other: (T0, T1, T2, T3))

§

fn is_empty(&self) -> bool

§

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

§

fn merge(&mut self, _other: (T0, T1, T2, T3, T4))

§

fn is_empty(&self) -> bool

§

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,

§

fn merge(&mut self, _other: (T0, T1, T2, T3, T4, T5))

§

fn is_empty(&self) -> bool

§

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,

§

fn merge(&mut self, _other: (T0, T1, T2, T3, T4, T5, T6))

§

fn is_empty(&self) -> bool

§

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,

§

fn merge(&mut self, _other: (T0, T1, T2, T3, T4, T5, T6, T7))

§

fn is_empty(&self) -> bool

§

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,

§

fn merge(&mut self, _other: (T0, T1, T2, T3, T4, T5, T6, T7, T8))

§

fn is_empty(&self) -> bool

§

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,

§

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,

§

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

§

fn merge(&mut self, other: BTreeSet<T>)

§

fn is_empty(&self) -> bool

Implementors§

Source§

impl Merge for bdk_chain::indexer::keychain_txout::ChangeSet

Source§

impl Merge for bdk_chain::local_chain::ChangeSet

Source§

impl<A: Ord> Merge for bdk_chain::tx_graph::ChangeSet<A>

Source§

impl<A: Anchor, IA: Merge> Merge for bdk_chain::indexed_tx_graph::ChangeSet<A, IA>

§

impl<T> Merge for Vec<T>