StepMut

Trait StepMut 

pub trait StepMut {
    // Required methods
    fn is_redundant(&self) -> bool;
    fn transform(
        &mut self,
        timestamp: DateTime<Utc>,
        attributes: &Attributes,
        value: &mut Value,
    ) -> Outcome;
}
Expand description

A step containing mutable internal state.

Compared to a normal Step, a StepMut can modify its internal state during transformation. Since the state is typically based on the input data, this also imposes a stronger requirement on the order of transformations. Step is stateless and doesn’t care about the chronological order of the input data, while a typical StepMut will require the input data to be in chronological order.

Required Methods§

fn is_redundant(&self) -> bool

Returns true if the step is redundant.

A step is redundant if any call to transform will always return Outcome::Continue without modifying the value or cause any side effects.

fn transform( &mut self, timestamp: DateTime<Utc>, attributes: &Attributes, value: &mut Value, ) -> Outcome

Transforms a value.

The function will directly modify value and inform the caller how to proceed using the Outcome.

Implementors§