Trait delta_inc::Transformer
source · [−]pub trait Transformer {
type Delta;
fn transform_into(&self, d: &Self::Delta) -> Self;
}
Expand description
A trait describing something which can be transformed by
applying a delta. For example, an array [0,1,2]
can be
transformed into another [3,1,2]
by applying a delta which
assigns element 0
to 3
. This trait describes the functional
case, where the receiver is not modified.
Required Associated Types
Required Methods
sourcefn transform_into(&self, d: &Self::Delta) -> Self
fn transform_into(&self, d: &Self::Delta) -> Self
Apply a given delta to this transformable item, yielding a potentially updated version of this item.
Implementors
sourceimpl<T: Transformable + Clone> Transformer for T
impl<T: Transformable + Clone> Transformer for T
Provides a default trait implementation for every type which is transformable. This first clones the item, and then transforms it in place.