pub struct Expr { /* private fields */ }Implementations§
Source§impl Expr
impl Expr
pub fn identity() -> Expr
pub fn lit(value: impl Into<AnyValue<'static>>) -> Expr
pub fn range(sel: impl Into<Range<usize>>) -> Expr
pub fn select(name: impl Into<SmallStr>) -> Expr
pub fn warmup(period: usize) -> When
pub fn when(cond: impl Into<Expr>) -> When
pub fn every(interval: usize) -> When
pub fn throttle(duration: Duration) -> When
pub fn time(self) -> Expr
pub fn value(self) -> Expr
pub fn debug(self) -> Expr
pub fn attr(self, attr: impl Into<SmallStr>) -> Expr
pub fn rolling(self, window_size: usize) -> Expr
pub fn coalesce(self, rhs: impl Into<Expr>) -> Expr
pub fn first(self) -> Expr
pub fn last(self) -> Expr
pub fn sum(self) -> Expr
pub fn mean(self) -> Expr
pub fn stddev(self) -> Expr
pub fn min(self) -> Expr
pub fn max(self) -> Expr
pub fn var(self) -> Expr
pub fn skew(self) -> Expr
pub fn count(self) -> Expr
pub fn slope(self) -> Expr
pub fn unique(self) -> Expr
pub fn pow(self, exp: impl Into<Expr>) -> Expr
pub fn lt(self, rhs: impl Into<Expr>) -> Expr
pub fn lte(self, rhs: impl Into<Expr>) -> Expr
pub fn gt(self, rhs: impl Into<Expr>) -> Expr
pub fn gte(self, rhs: impl Into<Expr>) -> Expr
pub fn eq(self, rhs: impl Into<Expr>) -> Expr
pub fn ne(self, rhs: impl Into<Expr>) -> Expr
pub fn between(self, low: impl Into<Expr>, high: impl Into<Expr>) -> Expr
pub fn and(self, rhs: impl Into<Expr>) -> Expr
pub fn or(self, rhs: impl Into<Expr>) -> Expr
pub fn not(self) -> Expr
pub fn neg(self) -> Expr
pub fn abs(self) -> Expr
pub fn add(self, rhs: impl Into<Expr>) -> Expr
pub fn sub(self, rhs: impl Into<Expr>) -> Expr
pub fn mul(self, rhs: impl Into<Expr>) -> Expr
pub fn div(self, rhs: impl Into<Expr>) -> Expr
pub fn clamp(self, min: impl Into<Expr>, max: impl Into<Expr>) -> Expr
pub fn or_else(self, rhs: impl Into<Expr>) -> Expr
pub fn min_with(self, rhs: impl Into<Expr>) -> Expr
pub fn max_with(self, rhs: impl Into<Expr>) -> Expr
pub fn quantile(self, q: f32) -> Expr
pub fn stagnation(self, epsilon: f32) -> Expr
pub fn cast(self, to: DataType) -> Expr
Source§impl Expr
impl Expr
Sourcepub fn compile(self) -> Expr
pub fn compile(self) -> Expr
Walks the tree bottom-up and rewrites algebraically equivalent shapes into the smallest possible form. Specifically:
- Pure-literal subtrees fold (
Lit(2) + Lit(3)→Lit(5)) Add/Sub/Mul/Divwith one literal operand fuses into aUnary(Affine)(x * 5 + 3→Affine { scale: 5, bias: 3 })- Nested affines collapse:
s2 * (s1*x + b1) + b2→Affine(s2*s1, s2*b1 + b2)
Source§impl Expr
impl Expr
pub fn new(node: ExprNode) -> Self
pub fn id(&self) -> ExprId
pub fn name(&self) -> &str
pub fn alias(self, name: impl Into<SmallStr>) -> Self
pub fn is_literal(&self) -> bool
pub fn is_selector(&self) -> bool
pub fn is_schedule(&self) -> bool
pub fn into_schedule(self) -> Option<Expr>
pub fn walk(&self, f: &mut impl FnMut(&Expr))
Source§impl Expr
impl Expr
pub fn trigger(&mut self) -> Result<AnyValue<'a>, RadiateError>
pub fn evaluate<'a>( &'a mut self, input: &'a impl ProjectExpr<'a>, ) -> Result<AnyValue<'a>, RadiateError>
Trait Implementations§
impl StructuralPartialEq for Expr
Auto Trait Implementations§
impl Freeze for Expr
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnsafeUnpin for Expr
impl UnwindSafe for Expr
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