toasty_core/stmt/
func_count.rs1use super::{Expr, ExprFunc};
2
3#[derive(Clone, Debug, PartialEq)]
4pub struct FuncCount {
5 pub arg: Option<Box<Expr>>,
8
9 pub filter: Option<Box<Expr>>,
11}
12
13impl Expr {
14 pub fn count_star() -> Self {
15 Self::Func(ExprFunc::Count(FuncCount {
16 arg: None,
17 filter: None,
18 }))
19 }
20}
21
22impl From<FuncCount> for ExprFunc {
23 fn from(value: FuncCount) -> Self {
24 Self::Count(value)
25 }
26}
27
28impl From<FuncCount> for Expr {
29 fn from(value: FuncCount) -> Self {
30 Self::Func(value.into())
31 }
32}