Trait dipa::Patchable[][src]

pub trait Patchable<P> {
    fn apply_patch(&mut self, patch: P);
}

Modifies a type using n a patch.

You would typically create this patch using [Diffable.create_delta_towards].

You’ll typically serialize to a Diffable::Delta, send it over a network and then deserialize to Diffable::DeltaOwned. Then you would use that owned delta as the patch to apply via [Patchable.apply_patch].

FIXME: This should return a result since it is possible to, for example, accidentally apply a a patch to the wrong data structure do to a logical bug.

Required methods

fn apply_patch(&mut self, patch: P)[src]

Apply a patch.

Loading content...

Implementations on Foreign Types

impl<T> Patchable<Vec<SequenceModificationDeltaOwned<T>, Global>> for Vec<T>[src]

impl Patchable<bool> for bool[src]

impl<'s, 'e, 'a, T> Patchable<<Cow<'a, T> as Diffable<'s, 'e, Cow<'a, T>>>::DeltaOwned> for Cow<'a, T> where
    T: ToOwned,
    T: ?Sized,
    T: Diffable<'s, 'e, T>,
    <T as ToOwned>::Owned: Patchable<<T as Diffable<'s, 'e, T>>::DeltaOwned>, 
[src]

impl Patchable<Option<f32>> for f32[src]

impl Patchable<Option<f64>> for f64[src]

impl Patchable<u8> for u8[src]

impl Patchable<u8> for &mut u8[src]

impl Patchable<i8> for i8[src]

impl Patchable<i8> for &mut i8[src]

impl Patchable<Option<u16>> for u16[src]

impl Patchable<Option<i16>> for i16[src]

impl Patchable<Option<u32>> for u32[src]

impl Patchable<Option<i32>> for i32[src]

impl Patchable<Option<u64>> for u64[src]

impl Patchable<Option<i64>> for i64[src]

impl Patchable<Option<u128>> for u128[src]

impl Patchable<Option<i128>> for i128[src]

impl<'s, 'e, K, V> Patchable<<HashMap<K, V, RandomState> as Diffable<'s, 'e, HashMap<K, V, RandomState>>>::DeltaOwned> for HashMap<K, V> where
    K: 's + 'e + Eq + Hash,
    V: 'e + Diffable<'s, 'e, V>,
    V: Patchable<<V as Diffable<'s, 'e, V>>::DeltaOwned>,
    <V as Diffable<'s, 'e, V>>::Delta: Serialize,
    <V as Diffable<'s, 'e, V>>::DeltaOwned: DeserializeOwned
[src]

impl<'s, 'e, K, V> Patchable<<BTreeMap<K, V> as Diffable<'s, 'e, BTreeMap<K, V>>>::DeltaOwned> for BTreeMap<K, V> where
    K: 's + 'e + Eq + Hash + Ord,
    V: 'e + Diffable<'s, 'e, V>,
    V: Patchable<<V as Diffable<'s, 'e, V>>::DeltaOwned>,
    <V as Diffable<'s, 'e, V>>::Delta: Serialize,
    <V as Diffable<'s, 'e, V>>::DeltaOwned: DeserializeOwned
[src]

impl Patchable<()> for ()[src]

impl<'s, 'e, T> Patchable<<Option<T> as Diffable<'s, 'e, Option<T>>>::DeltaOwned> for Option<T> where
    T: 'e,
    T: Diffable<'s, 'e, T>,
    T: Patchable<<T as Diffable<'s, 'e, T>>::DeltaOwned>,
    <T as Diffable<'s, 'e, T>>::Delta: Serialize,
    <T as Diffable<'s, 'e, T>>::DeltaOwned: DeserializeOwned
[src]

impl<'s, 'e, K> Patchable<<HashSet<K, RandomState> as Diffable<'s, 'e, HashSet<K, RandomState>>>::DeltaOwned> for HashSet<K> where
    K: 's + 'e + Eq + Hash
[src]

impl<'s, 'e, K> Patchable<<BTreeSet<K> as Diffable<'s, 'e, BTreeSet<K>>>::DeltaOwned> for BTreeSet<K> where
    K: 's + 'e + Eq + Hash + Ord
[src]

impl Patchable<Vec<SequenceModificationDeltaOwned<u8>, Global>> for String[src]

Loading content...

Implementors

Loading content...