pub fn aggregate<'outer, S, F, R>(f: F) -> RExpand description
Perform an aggregate that returns a single result for each of the current rows.
You can filter the rows in the aggregate based on values from the outer query. That is the only way to get a different aggregate for each outer row.
let res = txn.query_one(aggregate(|rows| {
let user = User::join(rows);
rows.count_distinct(user)
}));
assert_eq!(res, 1, "there is one user in the database");