Amalgamate

Trait Amalgamate 

Source
pub trait Amalgamate {
    type Key: Hash + Eq;

    // Required methods
    fn key(&self) -> Self::Key;
    fn amalgamate(&mut self, other: Self);
}
Expand description

Describes how an object can be combined with another object based on some criteria.

Required Associated Types§

Source

type Key: Hash + Eq

The type of the key that will be used to determine if two elements should be combined.

This type must implement Hash and Eq as it will internally be used as a key in a HashMap.

Required Methods§

Source

fn key(&self) -> Self::Key

Constructs the key that will be used to determine if two elements should be combined.

Source

fn amalgamate(&mut self, other: Self)

Determines if two elements should be combined.

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.

Implementors§