pub enum MutateOp {
Set {
path: String,
value: Vec<u8>,
},
Upsert {
path: String,
value: Vec<u8>,
},
Delete {
path: String,
},
Rename {
object_path: String,
from: String,
to: String,
},
MergeShallow {
path: String,
patch: Vec<u8>,
},
MergePatch {
path: String,
patch: Vec<u8>,
},
}Expand description
One mutation in a batch plan.
Variants§
Set
Overwrite an existing path (fails if missing).
Upsert
Insert or overwrite a path (creates parents as needed).
Delete
Delete object member or array element at path.
Rename
Rename a key on the object at object_path ("" = root).
MergeShallow
Shallow-merge a patch object into the object at path.
MergePatch
RFC 7396 merge patch at path ("" = root).
Implementations§
Source§impl MutateOp
impl MutateOp
Sourcepub fn set(path: impl Into<String>, value: &(impl ToJsonBytes + ?Sized)) -> Self
pub fn set(path: impl Into<String>, value: &(impl ToJsonBytes + ?Sized)) -> Self
Set with a typed value.
Sourcepub fn upsert(
path: impl Into<String>,
value: &(impl ToJsonBytes + ?Sized),
) -> Self
pub fn upsert( path: impl Into<String>, value: &(impl ToJsonBytes + ?Sized), ) -> Self
Upsert with a typed value.
Sourcepub fn rename(
object_path: impl Into<String>,
from: impl Into<String>,
to: impl Into<String>,
) -> Self
pub fn rename( object_path: impl Into<String>, from: impl Into<String>, to: impl Into<String>, ) -> Self
Rename key on object at object_path (empty = root).
Sourcepub fn merge_shallow(path: impl Into<String>, patch: impl Into<Vec<u8>>) -> Self
pub fn merge_shallow(path: impl Into<String>, patch: impl Into<Vec<u8>>) -> Self
MergeShallow patch object into path.
Sourcepub fn merge_patch(path: impl Into<String>, patch: impl Into<Vec<u8>>) -> Self
pub fn merge_patch(path: impl Into<String>, patch: impl Into<Vec<u8>>) -> Self
MergePatch RFC 7396 at path.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MutateOp
impl RefUnwindSafe for MutateOp
impl Send for MutateOp
impl Sync for MutateOp
impl Unpin for MutateOp
impl UnsafeUnpin for MutateOp
impl UnwindSafe for MutateOp
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more