pub enum PatchAction {
PutMap {
key: String,
value: (Value<'static>, ObjId),
conflict: bool,
},
PutSeq {
index: usize,
value: (Value<'static>, ObjId),
conflict: bool,
},
Insert {
index: usize,
values: SequenceTree<(Value<'static>, ObjId, bool)>,
},
SpliceText {
index: usize,
value: ConcreteTextValue,
marks: Option<MarkSet>,
},
Increment {
prop: Prop,
value: i64,
},
Conflict {
prop: Prop,
},
DeleteMap {
key: String,
},
DeleteSeq {
index: usize,
length: usize,
},
Mark {
marks: Vec<Mark>,
},
}Variants§
PutMap
A key was created or updated in a map
Fields
value: (Value<'static>, ObjId)The value that was inserted and the object ID of the object that was inserted. Note
that the Object ID is only meaningful for Value::Obj values
conflict: boolWhether there is a conflict at this key. If there is a conflict this patch represents
the “winning” value of the conflict. The conflicting values can be obtained with
crate::ReadDoc::get_all
PutSeq
An index in a sequence was updated
Fields
value: (Value<'static>, ObjId)The value that was set and the object ID of the object that was set. Note that the
Object ID is only meaningful for Value::Obj values
conflict: boolWhether there is a conflict at this index. If there is a conflict this patch represents
the “winning” value of the conflict. The conflicting values can be obtained with
crate::ReadDoc::get_all
Insert
One or more elements were inserted into a sequence
Fields
values: SequenceTree<(Value<'static>, ObjId, bool)>The values that were inserted, in order that they appear. As with Self::PutMap and
Self::PutSeq the object ID is only meaningful for Value::Obj values
SpliceText
Some text was spliced into a text object
Fields
value: ConcreteTextValueThe text that was inserted
Increment
A counter was incremented
Fields
Conflict
A new conflict has appeared
DeleteMap
A key was deleted from a map
DeleteSeq
One or more indices were removed from a sequence
Mark
Some marks within a text object were added or removed
Trait Implementations§
Source§impl Clone for PatchAction
impl Clone for PatchAction
Source§fn clone(&self) -> PatchAction
fn clone(&self) -> PatchAction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PatchAction
impl Debug for PatchAction
Source§impl Display for PatchAction
impl Display for PatchAction
Source§impl PartialEq for PatchAction
impl PartialEq for PatchAction
impl StructuralPartialEq for PatchAction
Auto Trait Implementations§
impl Freeze for PatchAction
impl RefUnwindSafe for PatchAction
impl Send for PatchAction
impl Sync for PatchAction
impl Unpin for PatchAction
impl UnsafeUnpin for PatchAction
impl UnwindSafe for PatchAction
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,
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