Debian Codegraph @

src/expression/unstable.rs

raw
1 use crate::expression::{is_aggregate, MixedAggregates, ValidGrouping};
2
3 // Note that these docs are similar to but slightly different than the stable
4 // docs below. Make sure if you change these that you also change the docs
5 // below.
6 /// Trait alias to represent an expression that isn't aggregate by default.
7 ///
8 /// This alias represents a type which is not aggregate if there is no group by
9 /// clause. More specifically, it represents for types which implement
10 /// [`ValidGrouping<()>`] where `IsAggregate` is [`is_aggregate::No`] or
11 /// [`is_aggregate::Yes`].
12 ///
13 /// While this trait is a useful stand-in for common cases, `T: NonAggregate`
14 /// cannot always be used when `T: ValidGrouping<(), IsAggregate = No>` or
15 /// `T: ValidGrouping<(), IsAggregate = Never>` could be. For that reason,
16 /// unless you need to abstract over both columns and literals, you should
17 /// prefer to use [`ValidGrouping<()>`] in your bounds instead.
18 ///
19 /// [`ValidGrouping<()>`]: ValidGrouping
20 pub trait NonAggregate = ValidGrouping<()>
21 where
22 <Self as ValidGrouping<()>>::IsAggregate:
23 MixedAggregates<is_aggregate::No, Output = is_aggregate::No>;