enum AlternativeExprs<'db> {
Few(FxHashSet<Expr<'db>>),
Many,
}Expand description
Helper enum to squash big number of alternative trees into Many variant as there is too many
to take into account.
Variants§
Few(FxHashSet<Expr<'db>>)
There are few trees, so we keep track of them all
Many
There are too many trees to keep track of
Implementations§
Source§impl<'db> AlternativeExprs<'db>
impl<'db> AlternativeExprs<'db>
Sourcefn new(
threshold: usize,
exprs: impl Iterator<Item = Expr<'db>>,
) -> AlternativeExprs<'db>
fn new( threshold: usize, exprs: impl Iterator<Item = Expr<'db>>, ) -> AlternativeExprs<'db>
Construct alternative trees
§Arguments
threshold - threshold value for many trees (more than that is many)
exprs - expressions iterator
Sourcefn exprs(&self, ty: &Type<'db>) -> Vec<Expr<'db>>
fn exprs(&self, ty: &Type<'db>) -> Vec<Expr<'db>>
Get type trees stored in alternative trees (or Expr::Many in case of many)
§Arguments
ty - Type of expressions queried (this is used to give type to Expr::Many)
Sourcefn extend_with_threshold(
&mut self,
threshold: usize,
exprs: impl Iterator<Item = Expr<'db>>,
)
fn extend_with_threshold( &mut self, threshold: usize, exprs: impl Iterator<Item = Expr<'db>>, )
Extend alternative expressions
§Arguments
threshold - threshold value for many trees (more than that is many)
exprs - expressions iterator
fn is_many(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl<'db> Freeze for AlternativeExprs<'db>
impl<'db> RefUnwindSafe for AlternativeExprs<'db>
impl<'db> Send for AlternativeExprs<'db>
impl<'db> Sync for AlternativeExprs<'db>
impl<'db> Unpin for AlternativeExprs<'db>
impl<'db> UnwindSafe for AlternativeExprs<'db>
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
Mutably borrows from an owned value. Read more
§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for 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>
Converts
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>
Converts
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