pub struct DocumentOp {
pub document_path: String,
pub component: String,
pub node_key: String,
pub node_index: Option<usize>,
pub item_id: String,
pub op_kind: String,
pub actor: OpActor,
pub clock: CausalClock,
pub before_preview: Option<String>,
pub after_preview: Option<String>,
pub recorded_at: Option<String>,
}Expand description
A durable record of one node-keyed document operation.
Fields§
§document_path: StringPath of the session document the op applies to.
component: StringComponent the node lives in (queue, exchange, backlog, …).
node_key: StringStable node key (component:occurrence:item-id:dup).
node_index: Option<usize>Position of the node within its component (after-index for inserts/
replaces, before-index for removes). Carries the tail-vs-old-block signal
the affectedness classifier needs to narrow exchange to its active tail
(#loop-guard-exchange-node-granularity). None when the source did not
supply an index (e.g. an op replayed from the durable store, which never
feeds the live classifier).
item_id: StringBacklog/queue item id, when the node carries one.
op_kind: StringOperation kind string (insert, remove, replace, move, strike,
unstrike) mirroring the markdown-AST node-event vocabulary.
actor: OpActorWho produced the op.
clock: CausalClockLamport tick + originating session.
before_preview: Option<String>Bounded preview of the node content before the op.
after_preview: Option<String>Bounded preview of the node content after the op.
recorded_at: Option<String>Wall-clock timestamp the op was recorded, when the caller supplies one.
Implementations§
Source§impl DocumentOp
impl DocumentOp
Sourcepub fn same_mutation(&self, other: &DocumentOp) -> bool
pub fn same_mutation(&self, other: &DocumentOp) -> bool
True when two ops describe the same node-level mutation (ignoring the writer-assigned Lamport tick and recording time). Used by the durable store to keep repeated preflight passes over the same uncommitted diff idempotent.
Trait Implementations§
Source§impl Clone for DocumentOp
impl Clone for DocumentOp
Source§impl Debug for DocumentOp
impl Debug for DocumentOp
Source§impl<'de> Deserialize<'de> for DocumentOp
impl<'de> Deserialize<'de> for DocumentOp
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for DocumentOp
Source§impl PartialEq for DocumentOp
impl PartialEq for DocumentOp
Source§impl Serialize for DocumentOp
impl Serialize for DocumentOp
impl StructuralPartialEq for DocumentOp
Auto Trait Implementations§
impl Forget for DocumentOp
impl Freeze for DocumentOp
impl RefUnwindSafe for DocumentOp
impl Send for DocumentOp
impl Sync for DocumentOp
impl Unpin for DocumentOp
impl UnsafeUnpin for DocumentOp
impl UnwindSafe for DocumentOp
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.