pub enum GenericPatchOperation<V>where
V: DiffableValue,{
Add {
path: String,
value: V,
},
Remove {
path: String,
},
Replace {
path: String,
value: V,
},
Move {
from: String,
path: String,
},
Copy {
from: String,
path: String,
},
Test {
path: String,
value: V,
},
}Expand description
A single patch operation (format-agnostic)
Modeled after RFC 6902 (JSON Patch) but generic over value types.
Variants§
Add
Add a value at a path
Remove
Remove the value at a path
Replace
Replace the value at a path
Move
Move a value from one path to another
Copy
Copy a value from one path to another
Test
Test that a value at a path equals the expected value
Implementations§
Source§impl<V> GenericPatchOperation<V>where
V: DiffableValue,
impl<V> GenericPatchOperation<V>where
V: DiffableValue,
Sourcepub const fn is_replace(&self) -> bool
pub const fn is_replace(&self) -> bool
Check if this is a replace operation
Trait Implementations§
Source§impl<V> Clone for GenericPatchOperation<V>where
V: Clone + DiffableValue,
impl<V> Clone for GenericPatchOperation<V>where
V: Clone + DiffableValue,
Source§fn clone(&self) -> GenericPatchOperation<V>
fn clone(&self) -> GenericPatchOperation<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 for GenericPatchOperation<V>where
V: Debug + DiffableValue,
impl<V> Debug for GenericPatchOperation<V>where
V: Debug + DiffableValue,
Source§impl<V> Display for GenericPatchOperation<V>where
V: DiffableValue + Debug,
impl<V> Display for GenericPatchOperation<V>where
V: DiffableValue + Debug,
Source§impl<V> FromIterator<GenericPatchOperation<V>> for GenericPatch<V>where
V: DiffableValue,
impl<V> FromIterator<GenericPatchOperation<V>> for GenericPatch<V>where
V: DiffableValue,
Source§fn from_iter<I>(iter: I) -> GenericPatch<V>where
I: IntoIterator<Item = GenericPatchOperation<V>>,
fn from_iter<I>(iter: I) -> GenericPatch<V>where
I: IntoIterator<Item = GenericPatchOperation<V>>,
Creates a value from an iterator. Read more
Source§impl<V> PartialEq for GenericPatchOperation<V>where
V: PartialEq + DiffableValue,
impl<V> PartialEq for GenericPatchOperation<V>where
V: PartialEq + DiffableValue,
impl<V> Eq for GenericPatchOperation<V>where
V: Eq + DiffableValue,
impl<V> StructuralPartialEq for GenericPatchOperation<V>where
V: DiffableValue,
Auto Trait Implementations§
impl<V> Freeze for GenericPatchOperation<V>where
V: Freeze,
impl<V> RefUnwindSafe for GenericPatchOperation<V>where
V: RefUnwindSafe,
impl<V> Send for GenericPatchOperation<V>where
V: Send,
impl<V> Sync for GenericPatchOperation<V>where
V: Sync,
impl<V> Unpin for GenericPatchOperation<V>where
V: Unpin,
impl<V> UnwindSafe for GenericPatchOperation<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