pub struct JoinKeySet {
inner: IndexSet<(Expr, Expr)>,
}Expand description
Tracks a set of equality Join keys
A join key is an expression that is used to join two tables via an equality
predicate such as a.x = b.y
This struct models a.x + 5 = b.y AND a.z = b.z as two join keys
(a.x + 5, b.y)(a.z, b.z)
§Important properties:
- Retains insert order
- Can quickly look up if a pair of expressions are in the set.
Fields§
§inner: IndexSet<(Expr, Expr)>Implementations§
Source§impl JoinKeySet
impl JoinKeySet
Sourcepub fn contains(&self, left: &Expr, right: &Expr) -> bool
pub fn contains(&self, left: &Expr, right: &Expr) -> bool
Return true if the set contains a join pair where left = right or right = left
Sourcepub fn insert(&mut self, left: &Expr, right: &Expr) -> bool
pub fn insert(&mut self, left: &Expr, right: &Expr) -> bool
Insert the join key (left = right) into the set if join pair (right = left) is not already in the set
returns true if the pair was inserted
Sourcepub fn insert_owned(&mut self, left: Expr, right: Expr) -> bool
pub fn insert_owned(&mut self, left: Expr, right: Expr) -> bool
Same as Self::insert but avoids cloning expression if they
are owned
Sourcepub fn insert_all<'a>(
&mut self,
iter: impl IntoIterator<Item = &'a (Expr, Expr)>,
) -> bool
pub fn insert_all<'a>( &mut self, iter: impl IntoIterator<Item = &'a (Expr, Expr)>, ) -> bool
Inserts potentially many join keys into the set, copying only when necessary
returns true if any of the pairs were inserted
Sourcepub fn insert_all_owned(
&mut self,
iter: impl IntoIterator<Item = (Expr, Expr)>,
) -> bool
pub fn insert_all_owned( &mut self, iter: impl IntoIterator<Item = (Expr, Expr)>, ) -> bool
Same as Self::insert_all but avoids cloning expressions if they are
already owned
returns true if any of the pairs were inserted
Sourcepub fn insert_intersection(&mut self, s1: &JoinKeySet, s2: &JoinKeySet)
pub fn insert_intersection(&mut self, s1: &JoinKeySet, s2: &JoinKeySet)
Inserts any join keys that are common to both s1 and s2 into self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JoinKeySet
impl !RefUnwindSafe for JoinKeySet
impl Send for JoinKeySet
impl Sync for JoinKeySet
impl Unpin for JoinKeySet
impl !UnwindSafe for JoinKeySet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more