pub enum PatchOperation {
Set {
path: String,
value: String,
},
Unset {
path: String,
},
Remove {
path: String,
},
Increment {
path: String,
amount: i64,
},
Append {
path: String,
value: String,
},
Prepend {
path: String,
value: String,
},
Merge {
path: String,
value: String,
},
Replace {
path: String,
value: String,
},
}Expand description
A single document patch operation.
Variants§
Implementations§
Source§impl PatchOperation
impl PatchOperation
Sourcepub fn append(path: impl AsRef<str>, value: impl Into<String>) -> Self
pub fn append(path: impl AsRef<str>, value: impl Into<String>) -> Self
Creates an append operation.
Sourcepub fn prepend(path: impl AsRef<str>, value: impl Into<String>) -> Self
pub fn prepend(path: impl AsRef<str>, value: impl Into<String>) -> Self
Creates a prepend operation.
Sourcepub fn merge(path: impl AsRef<str>, value: impl Into<String>) -> Self
pub fn merge(path: impl AsRef<str>, value: impl Into<String>) -> Self
Creates a merge operation.
Trait Implementations§
Source§impl Clone for PatchOperation
impl Clone for PatchOperation
Source§fn clone(&self) -> PatchOperation
fn clone(&self) -> PatchOperation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PatchOperation
impl Debug for PatchOperation
Source§impl Hash for PatchOperation
impl Hash for PatchOperation
Source§impl PartialEq for PatchOperation
impl PartialEq for PatchOperation
Source§fn eq(&self, other: &PatchOperation) -> bool
fn eq(&self, other: &PatchOperation) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for PatchOperation
impl StructuralPartialEq for PatchOperation
Auto Trait Implementations§
impl Freeze for PatchOperation
impl RefUnwindSafe for PatchOperation
impl Send for PatchOperation
impl Sync for PatchOperation
impl Unpin for PatchOperation
impl UnsafeUnpin for PatchOperation
impl UnwindSafe for PatchOperation
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