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

§index: usize
§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

§index: usize
§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

§marks: Option<MarkSet>

All marks currently active for these values

One or more elements were inserted into a sequence

§

SpliceText

Fields

§index: usize
§value: TextValue

The text that was inserted

§marks: Option<MarkSet>

All marks currently active for this span of text

Some text was spliced into a text object

§

Increment

Fields

§prop: Prop

The property of the counter that was incremented within the target object

§value: i64

The amount incremented, may be negative

A counter was incremented

§

Conflict

Fields

§prop: Prop

The conflicted property

A new conflict has appeared

§

DeleteMap

Fields

A key was deleted from a map

§

DeleteSeq

Fields

§index: usize
§length: usize

One or more indices were removed from a sequence

§

Mark

Fields

§marks: Vec<Mark<'static>>

Some marks within a text object were added or removed

Trait Implementations§

source§

impl Clone for PatchAction

source§

fn clone(&self) -> PatchAction

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PatchAction

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for PatchAction

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<PatchAction> for PatchAction

source§

fn eq(&self, other: &PatchAction) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for PatchAction

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more