HalfJoinState

Trait HalfJoinState 

Source
pub trait HalfJoinState<Key, ValBuild, ValProbe>
where ValBuild: Clone,
{ // Required methods fn build(&mut self, k: Key, v: Cow<'_, 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 { ... } }
Expand description

State semantics for each half of a join.

Required Methods§

Source

fn build(&mut self, k: Key, v: Cow<'_, 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.

Source

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

Source

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.

Source

fn len(&self) -> usize

Len of the join state in terms of number of keys.

Source

fn iter(&self) -> Iter<'_, Key, SmallVec<[ValBuild; 1]>>

An iter over all entries of the state.

Source

fn full_probe(&self, k: &Key) -> Iter<'_, ValBuild>

An iter over all the matches for a given key.

Provided Methods§

Source

fn is_empty(&self) -> bool

If the state is empty (len() == 0).

Implementors§

Source§

impl<Key, ValBuild, ValProbe> HalfJoinState<Key, ValBuild, ValProbe> for HalfMultisetJoinState<Key, ValBuild, ValProbe>
where Key: Clone + Eq + Hash, ValBuild: Clone, ValProbe: Clone,

Source§

impl<Key, ValBuild, ValProbe> HalfJoinState<Key, ValBuild, ValProbe> for HalfSetJoinState<Key, ValBuild, ValProbe>
where Key: Clone + Eq + Hash, ValBuild: Clone + Eq, ValProbe: Clone,