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>,
},
}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.
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.
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