Trait dipa::Patchable [−][src]
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.
Implementations on Foreign Types
impl<T> Patchable<Vec<SequenceModificationDeltaOwned<T>, Global>> for Vec<T>
[src]
fn apply_patch(&mut self, patch: Vec<SequenceModificationDeltaOwned<T>>)
[src]
impl Patchable<bool> for bool
[src]
fn apply_patch(&mut self, patch: 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]
T: ToOwned,
T: ?Sized,
T: Diffable<'s, 'e, T>,
<T as ToOwned>::Owned: Patchable<<T as Diffable<'s, 'e, T>>::DeltaOwned>,
fn apply_patch(&mut self, patch: <T as Diffable<'s, 'e, T>>::DeltaOwned)
[src]
impl Patchable<Option<f32>> for f32
[src]
fn apply_patch(&mut self, patch: Option<f32>)
[src]
impl Patchable<Option<f64>> for f64
[src]
fn apply_patch(&mut self, patch: Option<f64>)
[src]
impl Patchable<u8> for u8
[src]
fn apply_patch(&mut self, patch: u8)
[src]
impl Patchable<u8> for &mut u8
[src]
fn apply_patch(&mut self, patch: u8)
[src]
impl Patchable<i8> for i8
[src]
fn apply_patch(&mut self, patch: i8)
[src]
impl Patchable<i8> for &mut i8
[src]
fn apply_patch(&mut self, patch: i8)
[src]
impl Patchable<Option<u16>> for u16
[src]
fn apply_patch(&mut self, patch: Option<u16>)
[src]
impl Patchable<Option<i16>> for i16
[src]
fn apply_patch(&mut self, patch: Option<i16>)
[src]
impl Patchable<Option<u32>> for u32
[src]
fn apply_patch(&mut self, patch: Option<u32>)
[src]
impl Patchable<Option<i32>> for i32
[src]
fn apply_patch(&mut self, patch: Option<i32>)
[src]
impl Patchable<Option<u64>> for u64
[src]
fn apply_patch(&mut self, patch: Option<u64>)
[src]
impl Patchable<Option<i64>> for i64
[src]
fn apply_patch(&mut self, patch: Option<i64>)
[src]
impl Patchable<Option<u128>> for u128
[src]
fn apply_patch(&mut self, patch: Option<u128>)
[src]
impl Patchable<Option<i128>> for i128
[src]
fn apply_patch(&mut self, patch: Option<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]
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,
fn apply_patch(
&mut self,
patch: <HashMap<K, V> as Diffable<'s, 'e, HashMap<K, V>>>::DeltaOwned
)
[src]
&mut self,
patch: <HashMap<K, V> as Diffable<'s, 'e, HashMap<K, V>>>::DeltaOwned
)
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]
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,
fn apply_patch(
&mut self,
patch: <BTreeMap<K, V> as Diffable<'s, 'e, BTreeMap<K, V>>>::DeltaOwned
)
[src]
&mut self,
patch: <BTreeMap<K, V> as Diffable<'s, 'e, BTreeMap<K, V>>>::DeltaOwned
)
impl Patchable<()> for ()
[src]
fn apply_patch(&mut self, _patch: ())
[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]
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,
fn apply_patch(
&mut self,
patch: <Option<T> as Diffable<'s, 'e, Option<T>>>::DeltaOwned
)
[src]
&mut self,
patch: <Option<T> as Diffable<'s, 'e, Option<T>>>::DeltaOwned
)
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]
K: 's + 'e + Eq + Hash,
fn apply_patch(
&mut self,
patch: <HashSet<K> as Diffable<'s, 'e, HashSet<K>>>::DeltaOwned
)
[src]
&mut self,
patch: <HashSet<K> as Diffable<'s, 'e, HashSet<K>>>::DeltaOwned
)
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]
K: 's + 'e + Eq + Hash + Ord,
fn apply_patch(
&mut self,
patch: <BTreeSet<K> as Diffable<'s, 'e, BTreeSet<K>>>::DeltaOwned
)
[src]
&mut self,
patch: <BTreeSet<K> as Diffable<'s, 'e, BTreeSet<K>>>::DeltaOwned
)