Trait Apply

Source
pub trait Apply {
    type Parent;

    // Required method
    fn apply_to_base(
        &self,
        source: &mut Self::Parent,
        errs: &mut Vec<ApplyError>,
    );
}
Expand description

A trait that must implemented by any type that results from a ‘diff’ operation. It allows the (child) ‘diff’ type to be ‘applied’ to the parent type, mutating the parent in place to result in the value which is was originally diffed against.

Generally the user will not need to implement this type, as it will be done by the derive(Diffable) macro

Required Associated Types§

Required Methods§

Source

fn apply_to_base(&self, source: &mut Self::Parent, errs: &mut Vec<ApplyError>)

Implementations on Foreign Types§

Source§

impl<'a, K, V> Apply for BTreeMap<K, KvDiff<'a, V, V::Diff>>
where K: Ord + Eq + Clone, V: Diffable<'a> + Clone,

Source§

type Parent = BTreeMap<K, V>

Source§

fn apply_to_base(&self, source: &mut Self::Parent, errs: &mut Vec<ApplyError>)

Source§

impl<'a, K, V> Apply for HashMap<K, KvDiff<'a, V, V::Diff>>
where K: Hash + Eq + Clone, V: Diffable<'a> + Clone,

Source§

type Parent = HashMap<K, V>

Source§

fn apply_to_base(&self, source: &mut Self::Parent, errs: &mut Vec<ApplyError>)

Source§

impl<A> Apply for (A,)
where A: Apply,

Source§

type Parent = (<A as Apply>::Parent,)

Source§

fn apply_to_base(&self, source: &mut Self::Parent, errs: &mut Vec<ApplyError>)

Source§

impl<A, B> Apply for (A, B)
where A: Apply, B: Apply,

Source§

type Parent = (<A as Apply>::Parent, <B as Apply>::Parent)

Source§

fn apply_to_base(&self, source: &mut Self::Parent, errs: &mut Vec<ApplyError>)

Source§

impl<A, B, C> Apply for (A, B, C)
where A: Apply, B: Apply, C: Apply,

Source§

type Parent = (<A as Apply>::Parent, <B as Apply>::Parent, <C as Apply>::Parent)

Source§

fn apply_to_base(&self, source: &mut Self::Parent, errs: &mut Vec<ApplyError>)

Source§

impl<A, B, C, D> Apply for (A, B, C, D)
where A: Apply, B: Apply, C: Apply, D: Apply,

Source§

type Parent = (<A as Apply>::Parent, <B as Apply>::Parent, <C as Apply>::Parent, <D as Apply>::Parent)

Source§

fn apply_to_base(&self, source: &mut Self::Parent, errs: &mut Vec<ApplyError>)

Source§

impl<A, B, C, D, E> Apply for (A, B, C, D, E)
where A: Apply, B: Apply, C: Apply, D: Apply, E: Apply,

Source§

type Parent = (<A as Apply>::Parent, <B as Apply>::Parent, <C as Apply>::Parent, <D as Apply>::Parent, <E as Apply>::Parent)

Source§

fn apply_to_base(&self, source: &mut Self::Parent, errs: &mut Vec<ApplyError>)

Source§

impl<A, B, C, D, E, F> Apply for (A, B, C, D, E, F)
where A: Apply, B: Apply, C: Apply, D: Apply, E: Apply, F: Apply,

Source§

type Parent = (<A as Apply>::Parent, <B as Apply>::Parent, <C as Apply>::Parent, <D as Apply>::Parent, <E as Apply>::Parent, <F as Apply>::Parent)

Source§

fn apply_to_base(&self, source: &mut Self::Parent, errs: &mut Vec<ApplyError>)

Source§

impl<A, B, C, D, E, F, G> Apply for (A, B, C, D, E, F, G)
where A: Apply, B: Apply, C: Apply, D: Apply, E: Apply, F: Apply, G: Apply,

Source§

type Parent = (<A as Apply>::Parent, <B as Apply>::Parent, <C as Apply>::Parent, <D as Apply>::Parent, <E as Apply>::Parent, <F as Apply>::Parent, <G as Apply>::Parent)

Source§

fn apply_to_base(&self, source: &mut Self::Parent, errs: &mut Vec<ApplyError>)

Source§

impl<A, B, C, D, E, F, G, H> Apply for (A, B, C, D, E, F, G, H)
where A: Apply, B: Apply, C: Apply, D: Apply, E: Apply, F: Apply, G: Apply, H: Apply,

Source§

type Parent = (<A as Apply>::Parent, <B as Apply>::Parent, <C as Apply>::Parent, <D as Apply>::Parent, <E as Apply>::Parent, <F as Apply>::Parent, <G as Apply>::Parent, <H as Apply>::Parent)

Source§

fn apply_to_base(&self, source: &mut Self::Parent, errs: &mut Vec<ApplyError>)

Source§

impl<A, B, C, D, E, F, G, H, I> Apply for (A, B, C, D, E, F, G, H, I)
where A: Apply, B: Apply, C: Apply, D: Apply, E: Apply, F: Apply, G: Apply, H: Apply, I: Apply,

Source§

type Parent = (<A as Apply>::Parent, <B as Apply>::Parent, <C as Apply>::Parent, <D as Apply>::Parent, <E as Apply>::Parent, <F as Apply>::Parent, <G as Apply>::Parent, <H as Apply>::Parent, <I as Apply>::Parent)

Source§

fn apply_to_base(&self, source: &mut Self::Parent, errs: &mut Vec<ApplyError>)

Source§

impl<T> Apply for Option<T>
where T: Apply,

Source§

type Parent = Option<<T as Apply>::Parent>

Source§

fn apply_to_base(&self, source: &mut Self::Parent, errs: &mut Vec<ApplyError>)

Source§

impl<T> Apply for Box<T>
where T: Apply,

Source§

type Parent = Box<<T as Apply>::Parent>

Source§

fn apply_to_base(&self, source: &mut Self::Parent, errs: &mut Vec<ApplyError>)

Implementors§

Source§

impl<'a, T> Apply for VecDiff<'a, T, T::Diff>
where T: Diffable<'a> + Clone,

Source§

impl<'a, T, U> Apply for DeepDiff<'a, T, U>
where T: Diffable<'a> + Clone, U: Apply<Parent = T>,

Source§

impl<P> Apply for PatchOnlyDiff<P>
where P: Apply,

Source§

type Parent = <P as Apply>::Parent

Source§

impl<T> Apply for AtomicDiff<'_, T>
where T: Clone,

Source§

impl<T> Apply for Id<T>