pub struct ChangeBundle {
pub delta: Delta,
pub island_ops: Vec<IslandOp>,
pub line_ops: Vec<LineOp>,
pub mark_ops: Vec<MarkOp>,
}Expand description
One committed field edit: a text delta and the three op channels, applied in
field order (delta → islands → lines → marks) by
Content::apply_field_change.
A struct rather than four positional arguments so a fifth channel is an
additive change at every call site. Default is the identity bundle (no
text change, no ops), so a caller names only the channels it uses:
ChangeBundle { delta, ..Default::default() }.
Within a channel ops apply in sequence: op n’s coordinates read the state
ops 0..n left, not the frame the channel opens in. That is USV positions
for an island insert (its at counts the slots earlier inserts spliced) and
line indices for LineOp::Split / LineOp::Join, which renumber every
later line. A stale frame stays in range, so the bundle applies cleanly and
lands the wrong document.
Fields§
§delta: DeltaThe text splice; the identity delta (no ops) is no text change.
island_ops: Vec<IslandOp>Island edits, opening in post-delta coordinates and sequenced.
line_ops: Vec<LineOp>Line edits, opening in post-delta, post-island-op coordinates and sequenced.
mark_ops: Vec<MarkOp>Mark edits, in final-text coordinates (every earlier stage applied).
Implementations§
Source§impl ChangeBundle
impl ChangeBundle
Sourcepub fn from_delta(delta: Delta) -> ChangeBundle
pub fn from_delta(delta: Delta) -> ChangeBundle
A bundle carrying delta and no ops: the per-keystroke splice.
Trait Implementations§
Source§impl Clone for ChangeBundle
impl Clone for ChangeBundle
Source§fn clone(&self) -> ChangeBundle
fn clone(&self) -> ChangeBundle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more