pub trait ACMapInsert<S: PauliStorage, V: Coefficient, H: BuildHasher + Clone + Default, W: PauliWordTrait> {
// Required methods
fn map_insert_vec<F>(&mut self, dest: &mut Vec<(W, V)>, f: F)
where F: Fn(&W, &mut V) -> Option<(W, V)> + Sync + Send;
fn map_insert_multiple<F>(&mut self, dest: &mut Self, f: F)
where F: Fn(&W, &mut V) -> Option<Vec<(W, V)>> + Sync + Send;
}Expand description
In-place modify + insert pattern used to express branching gates (where one input entry can produce zero, one, or several output entries).
Required Methods§
Sourcefn map_insert_vec<F>(&mut self, dest: &mut Vec<(W, V)>, f: F)
fn map_insert_vec<F>(&mut self, dest: &mut Vec<(W, V)>, f: F)
Modify each existing entry in place; if f returns Some((k', v')),
append that new entry into dest, a plain Vec (a push per entry,
no hashing). This is the primary hot-path entry point: the caller
merges the buffer into the destination map afterwards, avoiding a
second hashmap probe per produced entry.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".