Skip to main content

ACMapAddAssign

Trait ACMapAddAssign 

Source
pub trait ACMapAddAssign<S, V, H, W>{
    // Required methods
    fn add_assign(&mut self, key: W, value: V);
    fn map_add_assign<F>(&self, dest: &mut Self, f: F)
       where F: Fn(&W, &V) -> (W, V) + Sync + Send;
}
Expand description

+= semantics for an ACMap: insert a new entry or accumulate into the existing one with the same key.

Required Methods§

Source

fn add_assign(&mut self, key: W, value: V)

Add value into the entry at key, creating the entry if absent.

Source

fn map_add_assign<F>(&self, dest: &mut Self, f: F)
where F: Fn(&W, &V) -> (W, V) + Sync + Send,

For every entry, compute f(key, value) and add the result into dest with add_assign.

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<'a, S, V, Hasher, W> ACMapAddAssign<S, V, Hasher, W> for AHashMap<W, V, Hasher>
where S: PauliStorage + 'a, V: Coefficient + 'a, Hasher: Default + Clone + BuildHasher + 'a, W: PauliWordTrait + 'a,

Source§

fn add_assign(&mut self, key: W, value: V)

Source§

fn map_add_assign<F>(&self, dest: &mut AHashMap<W, V, Hasher>, f: F)
where F: Fn(&W, &V) -> (W, V) + Sync + Send,

Source§

impl<'a, S, V, Hasher, W> ACMapAddAssign<S, V, Hasher, W> for HashMap<W, V, Hasher>
where S: PauliStorage + 'a, V: Coefficient + 'a, Hasher: Default + Clone + BuildHasher + 'a, W: PauliWordTrait + 'a,

Source§

fn add_assign(&mut self, key: W, value: V)

Source§

fn map_add_assign<F>(&self, dest: &mut HashMap<W, V, Hasher>, f: F)
where F: Fn(&W, &V) -> (W, V) + Sync + Send,

Source§

impl<'a, S, V, Hasher, W> ACMapAddAssign<S, V, Hasher, W> for IndexMap<W, V, Hasher>
where S: PauliStorage + 'a, V: Coefficient + 'a, Hasher: Default + Clone + BuildHasher + 'a, W: PauliWordTrait + 'a,

Source§

fn add_assign(&mut self, key: W, value: V)

Source§

fn map_add_assign<F>(&self, dest: &mut IndexMap<W, V, Hasher>, f: F)
where F: Fn(&W, &V) -> (W, V) + Sync + Send,

Source§

impl<S, V, Hasher, W> ACMapAddAssign<S, V, Hasher, W> for DashMap<W, V, Hasher>

Source§

fn add_assign(&mut self, key: W, value: V)

Source§

fn map_add_assign<F>(&self, dest: &mut DashMap<W, V, Hasher>, f: F)
where F: Fn(&W, &V) -> (W, V) + Sync + Send,

Implementors§