Module bustools::disjoint

source ·
Expand description

Module for the Intersector struct

The Intersector represents a list of key/values, such that a new item i with key k is added to a key/value pair if the key k intersects with the key in the k/v pair

e.g.

Action           state
add {'A'}:1 ->   {'A'}:1
add {'B'}:2 ->   {'A'}:1, {'B'}:2  // since keys dont overlap
add {'A'}:3 ->   {'A'}:[1,3], {'B'}:2  // new element gets merged into the first group "A"
add {'A', 'B'}: 4 ->   {'A'}:[1,3, 4], {'B'}:2 //note, its added to the first key found

Structs§

  • special “HashMap” with keys: Sets of type T and values of Vec<S> if keys overlap, their values will be merged