pub struct MetricDef {
pub name: String,
pub expression_template: Option<String>,
pub return_type: DimType,
pub description: Option<String>,
pub supports_where: bool,
}Expand description
Metric definition — standard SQL aggregate or custom expression.
Fields§
§name: String§expression_template: Option<String>If None, uses the standard SQL function (COUNT/SUM/AVG/…).
If Some, uses this SQL template with {column} as placeholder.
Example: "sumIf({column}, direction='in') - sumIf({column}, direction='out')"
return_type: DimType§description: Option<String>§supports_where: boolWhether this metric supports conditional aggregation (countIf/sumIf).
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MetricDef
impl RefUnwindSafe for MetricDef
impl Send for MetricDef
impl Sync for MetricDef
impl Unpin for MetricDef
impl UnsafeUnpin for MetricDef
impl UnwindSafe for MetricDef
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