Enum PatchOperation
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§
§impl PatchOperation
impl PatchOperation
pub fn set(path: impl AsRef<str>, value: impl Into<String>) -> PatchOperation
pub fn set(path: impl AsRef<str>, value: impl Into<String>) -> PatchOperation
Creates a set operation.
pub fn unset(path: impl AsRef<str>) -> PatchOperation
pub fn unset(path: impl AsRef<str>) -> PatchOperation
Creates an unset operation.
pub fn remove(path: impl AsRef<str>) -> PatchOperation
pub fn remove(path: impl AsRef<str>) -> PatchOperation
Creates a remove operation.
pub fn increment(path: impl AsRef<str>, amount: i64) -> PatchOperation
pub fn increment(path: impl AsRef<str>, amount: i64) -> PatchOperation
Creates an increment operation.
pub fn append(path: impl AsRef<str>, value: impl Into<String>) -> PatchOperation
pub fn append(path: impl AsRef<str>, value: impl Into<String>) -> PatchOperation
Creates an append operation.
pub fn prepend(
path: impl AsRef<str>,
value: impl Into<String>,
) -> PatchOperation
pub fn prepend( path: impl AsRef<str>, value: impl Into<String>, ) -> PatchOperation
Creates a prepend operation.
pub fn merge(path: impl AsRef<str>, value: impl Into<String>) -> PatchOperation
pub fn merge(path: impl AsRef<str>, value: impl Into<String>) -> PatchOperation
Creates a merge operation.
Trait Implementations§
§impl Clone for PatchOperation
impl Clone for PatchOperation
§fn clone(&self) -> PatchOperation
fn clone(&self) -> PatchOperation
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 more§impl Debug for PatchOperation
impl Debug for PatchOperation
§impl Hash for PatchOperation
impl Hash for PatchOperation
§impl PartialEq for PatchOperation
impl PartialEq for PatchOperation
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