pub enum EditOp {
Show 21 variants
Set {
value: Value,
},
Splice {
at: usize,
delete: usize,
insert: String,
},
Replace {
text: String,
},
Add {
by: i64,
},
Insert {
value: Value,
},
Remove {
value: Value,
},
InsertItem {
id: Option<Id>,
at: At,
value: Value,
},
UpsertItem {
matching: Map<String, Value>,
value: Value,
id: Option<Id>,
},
RemoveItem {
id: Id,
},
MoveTo {
id: Id,
at: At,
},
RemoveKey {
key: String,
},
SetCell {
row: Id,
column: Id,
value: Option<Value>,
},
InsertRow {
id: Option<Id>,
at: usize,
},
InsertColumn {
id: Option<Id>,
at: usize,
},
RemoveRow {
id: Id,
},
RemoveColumn {
id: Id,
},
Settle {
id: Id,
outcome: Value,
},
Forget {
id: Id,
},
React {
emoji: String,
},
Unreact {
emoji: String,
},
Rich {
rich: Value,
},
}Expand description
What an Edit does at its path. Text positions count characters.
Variants§
Set
Replace the value with one in its JSON form (Model::to_json).
Splice
Replace delete characters at at with insert.
Replace
Replace the whole text by the smallest splice.
Add
Add to a Counter.
Insert
Add an element to a Set.
Remove
Remove an element from a Set.
InsertItem
Insert an item into a collection; id: None mints one.
UpsertItem
Update the one item of a collection whose fields hold matching
with the fields of value, else append value (with matching’s
fields) as a new item, under id when given. Resolved against the
document as it is when the edit applies; refused when more than one
item matches.
RemoveItem
Remove an item from a collection.
MoveTo
Move an item within a collection.
RemoveKey
Remove an entry of a map.
SetCell
Set (Some) or clear (None) a grid cell.
InsertRow
InsertColumn
RemoveRow
RemoveColumn
Settle
Settle an outbox entry, with its Settled in JSON
form.
Forget
Forget a settled outbox entry.
React
React with emoji to what holds a Reactions
field, as whoever invokes the edit.
Unreact
Take back the invoker’s reaction with emoji.
Rich
An edit of a type with its own vocabulary (Operations: rich text
marks and blocks), in that type’s JSON form.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for EditOp
impl<'de> Deserialize<'de> for EditOp
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
impl StructuralPartialEq for EditOp
Auto Trait Implementations§
impl Forget for EditOp
impl Freeze for EditOpwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Value>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
impl Move for EditOp
impl RefUnwindSafe for EditOp
impl Send for EditOp
impl Sync for EditOp
impl Unpin for EditOp
impl UnsafeUnpin for EditOpwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
impl UnwindSafe for EditOp
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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