pub enum Transform {
Show 25 variants
Identity,
Expression {
expr: String,
},
Scale {
from_min: f64,
from_max: f64,
to_min: f64,
to_max: f64,
},
Clamp {
min: f64,
max: f64,
},
Invert,
ToInt,
ToFloat,
Lookup {
table: HashMap<String, Value>,
default: Option<Value>,
},
Curve {
curve_type: CurveType,
},
Quantize {
steps: u32,
},
DeadZone {
threshold: f64,
},
Smooth {
factor: f64,
},
RateLimit {
max_delta: f64,
},
Threshold {
value: f64,
mode: ThresholdMode,
},
Modulo {
divisor: f64,
},
Abs,
Negate,
Power {
exponent: f64,
},
Log {
base: Option<f64>,
},
Round {
decimals: u32,
},
Chain {
transforms: Vec<Transform>,
},
Conditional {
condition: Condition,
if_true: Box<Transform>,
if_false: Box<Transform>,
},
JsonPath {
path: String,
},
MapType {
from_type: ValueType,
to_type: ValueType,
},
Bitwise {
operation: BitwiseOp,
operand: Option<i64>,
},
}Expand description
Enhanced transform that can be applied to values
Variants§
Identity
No transformation (passthrough)
Expression
Mathematical expression evaluation
Variables: value, index, time
Scale
Scale from one range to another
Clamp
Clamp to range
Invert
Invert (1 - x for normalized values)
ToInt
Convert to integer
ToFloat
Convert to float
Lookup
Lookup table for discrete value mapping
Curve
Easing curve functions
Quantize
Quantize to discrete steps
DeadZone
Dead zone (values below threshold become 0)
Smooth
Smoothing with exponential moving average
RateLimit
Rate limiter (max change per update)
Threshold
Threshold trigger (output 0 or 1 based on threshold)
Modulo
Modulo operation
Abs
Absolute value
Negate
Negate
Power
Power function
Log
Logarithm
Round
Round to decimal places
Chain
Chain multiple transforms
Conditional
Conditional transform based on value
JsonPath
JSON path extraction (for complex values)
MapType
Map to different value type
Bitwise
Bitwise operations
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Transform
impl<'de> Deserialize<'de> for Transform
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Transform
impl RefUnwindSafe for Transform
impl Send for Transform
impl Sync for Transform
impl Unpin for Transform
impl UnsafeUnpin for Transform
impl UnwindSafe for Transform
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