Skip to main content

Mergeable

Trait Mergeable 

Source
pub trait Mergeable {
    // Required methods
    fn merge(&mut self, other: Self);
    fn merge_weak(&mut self, other: Self);
}
Expand description

Allow merging two objects of the same type into one.

Required Methods§

Source

fn merge(&mut self, other: Self)

Merge other into self, with other taking precedence.

Source

fn merge_weak(&mut self, other: Self)

Merge other into self, with self taking precedence.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Mergeable for bool

Source§

fn merge(&mut self, other: Self)

Source§

fn merge_weak(&mut self, other: Self)

Source§

impl<T> Mergeable for Option<T>

Source§

fn merge(&mut self, other: Self)

Source§

fn merge_weak(&mut self, other: Self)

Source§

impl<T> Mergeable for Vec<T>

Source§

fn merge(&mut self, other: Self)

Append other to self, in this order.

Ordering is influenced by the local desire to have prompts with higher precedence later.

Source§

fn merge_weak(&mut self, other: Self)

Append self to other, in this order, putting the result into self.

Ordering is influenced by the local desire to have prompts with higher precedence later.

Implementors§