pub struct GenericPatch<V: DiffableValue> {
pub operations: Vec<GenericPatchOperation<V>>,
}Expand description
A collection of patch operations (format-agnostic)
Represents a complete diff between two values as a sequence of operations.
Fields§
§operations: Vec<GenericPatchOperation<V>>The operations in this patch
Implementations§
Source§impl<V: DiffableValue> GenericPatch<V>
impl<V: DiffableValue> GenericPatch<V>
Sourcepub const fn with_operations(operations: Vec<GenericPatchOperation<V>>) -> Self
pub const fn with_operations(operations: Vec<GenericPatchOperation<V>>) -> Self
Create a patch with the given operations
Sourcepub fn push(&mut self, op: GenericPatchOperation<V>)
pub fn push(&mut self, op: GenericPatchOperation<V>)
Add an operation to this patch
Sourcepub fn iter(&self) -> impl Iterator<Item = &GenericPatchOperation<V>>
pub fn iter(&self) -> impl Iterator<Item = &GenericPatchOperation<V>>
Iterate over operations
Sourcepub fn operations_at_prefix(
&self,
prefix: &str,
) -> Vec<&GenericPatchOperation<V>>
pub fn operations_at_prefix( &self, prefix: &str, ) -> Vec<&GenericPatchOperation<V>>
Get operations that affect a specific path prefix
Trait Implementations§
Source§impl<V: Clone + DiffableValue> Clone for GenericPatch<V>
impl<V: Clone + DiffableValue> Clone for GenericPatch<V>
Source§fn clone(&self) -> GenericPatch<V>
fn clone(&self) -> GenericPatch<V>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<V: Debug + DiffableValue> Debug for GenericPatch<V>
impl<V: Debug + DiffableValue> Debug for GenericPatch<V>
Source§impl<V: Default + DiffableValue> Default for GenericPatch<V>
impl<V: Default + DiffableValue> Default for GenericPatch<V>
Source§fn default() -> GenericPatch<V>
fn default() -> GenericPatch<V>
Returns the “default value” for a type. Read more
Source§impl<V: DiffableValue> FromIterator<GenericPatchOperation<V>> for GenericPatch<V>
impl<V: DiffableValue> FromIterator<GenericPatchOperation<V>> for GenericPatch<V>
Source§fn from_iter<I: IntoIterator<Item = GenericPatchOperation<V>>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = GenericPatchOperation<V>>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl<V: DiffableValue> IntoIterator for GenericPatch<V>
impl<V: DiffableValue> IntoIterator for GenericPatch<V>
Auto Trait Implementations§
impl<V> Freeze for GenericPatch<V>
impl<V> RefUnwindSafe for GenericPatch<V>where
V: RefUnwindSafe,
impl<V> Send for GenericPatch<V>where
V: Send,
impl<V> Sync for GenericPatch<V>where
V: Sync,
impl<V> Unpin for GenericPatch<V>where
V: Unpin,
impl<V> UnwindSafe for GenericPatch<V>where
V: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more