Skip to main content

Operation

Enum Operation 

Source
pub enum Operation {
Show 13 variants Replace { target: Target, find: String, text: String, occurrence: Option<u64>, attached_comment: Option<AttachedComment>, }, Insert { target: Target, text: String, before_text: Option<String>, after_text: Option<String>, edge: Option<Edge>, occurrence: Option<u64>, attached_comment: Option<AttachedComment>, }, Delete { target: Target, find: String, occurrence: Option<u64>, }, Rewrite { target: Target, before_sha256: String, text: String, attached_comment: Option<AttachedComment>, }, InsertParagraph { target: Target, position: Side, text: String, attached_comment: Option<AttachedComment>, }, DeleteParagraph { target: Target, }, Comment { target: Target, text: String, find: Option<String>, occurrence: Option<u64>, through: Option<Target>, }, ReplyComment { target: Target, text: String, }, ResolveComment { target: Target, done: bool, }, EditComment { target: Target, text: String, }, DeleteComment { target: Target, include_replies: bool, }, Strike { target: Target, }, Restore { target: Target, },
}
Expand description

Typed requests in the text-and-review profile.

Literal occurrences are 1-based and count overlapping start positions. All active ranges resolve on one working baseline, not intermediate edits. Conflict detection, comment mapping and exact effects require preparation.

Variants§

§

Replace

Replace one exact literal range; empty text deletes only that range.

Fields

§target: Target

Original paragraph reference.

§find: String

Nonempty exact literal anchor.

§text: String

Exact replacement characters.

§occurrence: Option<u64>

Explicit 1-based match when an anchor repeats.

§attached_comment: Option<AttachedComment>

Comment on the nonempty resulting replacement.

§

Insert

Insert nonempty characters at exactly one declared working-text position.

Fields

§target: Target

Original paragraph reference.

§text: String

Exact inserted characters, including tabs and soft breaks.

§before_text: Option<String>

Insert before this nonempty exact literal.

§after_text: Option<String>

Insert after this nonempty exact literal.

§edge: Option<Edge>

Insert at a paragraph edge; excludes anchors and occurrence.

§occurrence: Option<u64>

Explicit match of a literal anchor; forbidden with edge.

§attached_comment: Option<AttachedComment>

Comment on the inserted text.

§

Delete

Delete one literal range. Whole-paragraph deletion is a separate kind.

Fields

§target: Target

Original paragraph reference.

§find: String

Nonempty exact literal anchor.

§occurrence: Option<u64>

Explicit 1-based literal match.

§

Rewrite

Exact desired paragraph text with a mandatory working-basis guard.

Fields

§target: Target

Original paragraph; requires verified one-to-one working correspondence.

§before_sha256: String

SHA-256 of the effective working paragraph text after selected accept/reject decisions, checked before unchanged classification.

§text: String

Desired exact characters. Empty retains the structural paragraph mark.

§attached_comment: Option<AttachedComment>

Comment on the complete nonempty resulting paragraph.

§

InsertParagraph

Insert a structural paragraph beside an existing anchor in its container.

Fields

§target: Target

Original existing anchor paragraph.

§position: Side

Explicit side; same-side requests retain array order.

§text: String

Exact paragraph characters; empty paragraphs are meaningful.

§attached_comment: Option<AttachedComment>

Comment on the complete nonempty inserted paragraph.

§

DeleteParagraph

Explicit structural paragraph deletion, subject to container/tracking support.

Fields

§target: Target

Original paragraph reference.

§

Comment

New comment on a paragraph, exact literal, or same-story paragraph range.

Fields

§target: Target

Original start paragraph.

§text: String

Nonempty plain comment text.

§find: Option<String>

Nonempty literal; excludes through.

§occurrence: Option<u64>

Requires find.

§through: Option<Target>

Inclusive original end paragraph; every covered paragraph must be in scope.

§

ReplyComment

Reply to a surviving original comment; sibling replies retain array order.

Fields

§target: Target

Existing original comment.

§text: String

Nonempty plain reply text.

§

ResolveComment

Explicit final thread state, applied after compatible replies.

Fields

§target: Target

Existing original comment in the affected thread.

§done: bool

True resolves the thread; false reopens it.

§

EditComment

Replace a comment body, preserving its recorded attribution.

Fields

§target: Target

Existing original comment.

§text: String

Nonempty replacement comment text.

§

DeleteComment

Explicit removal; conflicts with mutations of the affected comment/thread.

Fields

§target: Target

Existing original comment.

§include_replies: bool

Root removal with replies requires explicit inclusion.

§

Strike

Reject another author’s insertion visibly. The target names that revision.

Fields

§target: Target

The insertion, as changes lists it.

§

Restore

Reject another author’s deletion visibly. The target names that revision.

Fields

§target: Target

The deletion, as changes lists it.

Implementations§

Source§

impl Operation

Source

pub fn target(&self) -> &Target

Original source reference shared by every operation kind.

Trait Implementations§

Source§

impl Clone for Operation

Source§

fn clone(&self) -> Operation

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Operation

Source§

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

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

impl<'de> Deserialize<'de> for Operation

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Operation, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for Operation

Source§

impl PartialEq for Operation

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl Serialize for Operation

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Operation

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.