Trait dfir_rs::compiled::pull::HalfJoinState
source · pub trait HalfJoinState<Key, ValBuild, ValProbe> {
// Required methods
fn build(&mut self, k: Key, v: &ValBuild) -> bool;
fn probe(
&mut self,
k: &Key,
v: &ValProbe,
) -> Option<(Key, ValProbe, ValBuild)>;
fn pop_match(&mut self) -> Option<(Key, ValProbe, ValBuild)>;
fn len(&self) -> usize;
fn iter(&self) -> Iter<'_, Key, SmallVec<[ValBuild; 1]>>;
fn full_probe(&self, k: &Key) -> Iter<'_, ValBuild>;
// Provided method
fn is_empty(&self) -> bool { ... }
}
Required Methods§
sourcefn build(&mut self, k: Key, v: &ValBuild) -> bool
fn build(&mut self, k: Key, v: &ValBuild) -> bool
Insert a key value pair into the join state, currently this is always inserting into a hash table If the key-value pair exists then it is implementation defined what happens, usually either two copies are stored or only one copy is stored.
sourcefn probe(&mut self, k: &Key, v: &ValProbe) -> Option<(Key, ValProbe, ValBuild)>
fn probe(&mut self, k: &Key, v: &ValProbe) -> Option<(Key, ValProbe, ValBuild)>
This function does the actual joining part of the join. It looks up a key in the local join state and creates matches
The first match is return directly to the caller, and any additional matches are stored internally to be retrieved later with pop_match
sourcefn pop_match(&mut self) -> Option<(Key, ValProbe, ValBuild)>
fn pop_match(&mut self) -> Option<(Key, ValProbe, ValBuild)>
If there are any stored matches from previous calls to probe then this function will remove them one at a time and return it.