pub struct CommitBuilder {
label: String,
ops: Vec<OpCodes>,
}Expand description
Accumulates one gesture’s ops into a sealed Commit. Push order is
preserved verbatim — an op’s index is its Seq in the total write order,
so the builder’s order is the merge-relevant order (and a pasted
group’s internal stacking). Sealing consumes the builder, so a commit
cannot be extended after the fact, and a gesture that edited nothing
seals to None and submits nothing.
Deliberately blind to the document: dropping a non-edit (an update equal to what the document already holds) is the push site’s job — the op emitters can compare against the document, the builder cannot.
Fields§
§label: String§ops: Vec<OpCodes>Implementations§
Source§impl CommitBuilder
impl CommitBuilder
Sourcepub fn new(label: impl Into<String>) -> Self
pub fn new(label: impl Into<String>) -> Self
Start a gesture under its semantic label — a command’s stable name where a command triggered the edit, a tool-authored string otherwise.
Sourcepub fn extend(&mut self, ops: impl IntoIterator<Item = OpCodes>)
pub fn extend(&mut self, ops: impl IntoIterator<Item = OpCodes>)
Append a run of ops in order, as Self::push would one by one.