Enum automerge::patches::PatchAction
source · 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)>,
marks: Option<MarkSet>,
},
SpliceText {
index: usize,
value: TextValue,
marks: Option<MarkSet>,
},
Increment {
prop: Prop,
value: i64,
},
Conflict {
prop: Prop,
},
DeleteMap {
key: String,
},
DeleteSeq {
index: usize,
length: usize,
},
Mark {
marks: Vec<Mark<'static>>,
},
}
Variants§
PutMap
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: bool
Whether 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
A key was created or updated in a map
PutSeq
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: bool
Whether 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
An index in a sequence was updated
Insert
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
One or more elements were inserted into a sequence
SpliceText
Fields
value: TextValue
The text that was inserted
Some text was spliced into a text object
Increment
Fields
A counter was incremented
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 · 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<PatchAction> for PatchAction
impl PartialEq<PatchAction> for PatchAction
source§fn eq(&self, other: &PatchAction) -> bool
fn eq(&self, other: &PatchAction) -> bool
self
and other
values to be equal, and is used
by ==
.