Trait delta_inc::PartialTransformer
source · [−]pub trait PartialTransformer: Sized {
type Delta;
type Error;
fn transform_into(&self, d: &Self::Delta) -> Result<Self, Self::Error>;
}
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. Furthermore, this
trait allows for the possibility that the transformation may not
succeed.
Required Associated Types
Required Methods
sourcefn transform_into(&self, d: &Self::Delta) -> Result<Self, Self::Error>
fn transform_into(&self, d: &Self::Delta) -> Result<Self, Self::Error>
Apply a given delta to this transformable item, yielded a potentially updated version of this item or an error..
Implementors
sourceimpl<T: PartiallyTransformable + Clone> PartialTransformer for T
impl<T: PartiallyTransformable + Clone> PartialTransformer for T
Provides a default trait implementation for every type which is transformable. This first clones the item, and then transforms it in place.