sum_where

Macro sum_where 

Source
macro_rules! sum_where {
    ($data:expr, $sum_field:expr, $filter_field:expr, $pred:expr) => { ... };
    ($data:expr, $sum_field:expr) => { ... };
}
Expand description

Quick sum aggregation.

§Example

let total = sum_where!(products, Product::price(), Product::stock(), |&s| s > 0);