#[non_exhaustive]pub enum ApplyError {
Show 16 variants
MarkOutOfRange {
start: usize,
end: usize,
len: usize,
},
LineOutOfRange {
line: usize,
lines: usize,
},
SplitPositionOutOfRange {
at: usize,
len: usize,
},
SplitAtNewline {
at: usize,
},
LineCountMismatch {
lines: usize,
segments: usize,
},
FirstLineContinues,
DeltaBaseMismatch {
expected: usize,
actual: usize,
},
IslandSlotInInsert,
AnchorIdCollision {
id: String,
},
EmptyAnchorId,
UnknownIslandId {
id: String,
},
IslandIdCollision {
id: String,
},
EmptyIslandId,
IslandInsertOutOfRange {
at: usize,
len: usize,
},
LineKindMismatch {
line: usize,
mismatch: LineKindMismatch,
},
NestingTooDeep {
line: usize,
depth: usize,
max: usize,
},
}Expand description
Why an apply failed: range or line index out of bounds, or invariants broken before normalization could repair them.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MarkOutOfRange
LineOutOfRange
SplitPositionOutOfRange
SplitAtNewline
LineCountMismatch
FirstLineContinues
A LineOp::SetContinues tried to set continues: true on line 0, which
has nothing before it to continue, the apply-time twin of the
Invariant::FirstLineContinues
validation error, refused here because normalize does not repair it.
DeltaBaseMismatch
The text delta’s expected base length disagreed with the content: it was built against a different revision.
IslandSlotInInsert
An Op::Insert carried a raw ISLAND_SLOT. Islands are structurally
uneditable through the text channel: a slot inserted here would have no
backing Island, an orphaned-slot invariant violation. Islands are
created through IslandOp::Insert, which carries the slot and its
entry in one op, never a text splice.
A producer that computes one splice over the whole field text carries
slots in it whenever the user pastes an island or undoes a deletion that
removed one. Such a splice splits: the delta with its slots stripped,
plus one IslandOp::Insert per slot at the frame that delta leaves.
AnchorIdCollision
A MarkOp::Add of an anchor whose id is already live in the field.
An anchor id is a caller-supplied handle, unique per Content
(DOCUMENT_STORAGE.md § Anchor-id identity); add rejects a collision
rather than replace (which would silently retarget a live thread) or
coexist (which RemoveAnchor cannot disambiguate). The op-time twin of
Invariant::AnchorIdCollision.
EmptyAnchorId
A MarkOp::Add of an anchor with the empty id: a degenerate handle,
refused so every anchor carries a usable referent.
UnknownIslandId
An IslandOp::Set naming an id no island in the field carries,
refused rather than ignored (IslandOp::Set states why).
IslandIdCollision
An IslandOp::Insert whose id is already live in the field. Island
ids are unique per Content (the
Invariant::IslandIdCollision
this is the op-time twin of); Set addresses by id, so a duplicate is an
island neither op can name unambiguously.
EmptyIslandId
An IslandOp::Insert carrying the empty id: an island Set could
never address, refused on the same terms as Self::EmptyAnchorId.
IslandInsertOutOfRange
An IslandOp::Insert whose at is past the end of the text the delta
and this bundle’s earlier island ops left.
LineKindMismatch
A LineOp::SetKind whose kind contradicts the line’s text: tagging
prose Island or Rule, or a slot-bearing line Code. Export trusts the
kind over the text, so the write would silently drop the line’s content;
the op-time twin of
Invariant::LineKindMismatch,
refused here because normalize does not repair it.
NestingTooDeep
A LineOp::SetContainers nested a line deeper than
MAX_NESTING_DEPTH, the op-time twin of
Invariant::NestingTooDeep.
Trait Implementations§
Source§impl Clone for ApplyError
impl Clone for ApplyError
Source§fn clone(&self) -> ApplyError
fn clone(&self) -> ApplyError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ApplyError
impl Debug for ApplyError
impl Eq for ApplyError
Source§impl PartialEq for ApplyError
impl PartialEq for ApplyError
impl StructuralPartialEq for ApplyError
Auto Trait Implementations§
impl Freeze for ApplyError
impl RefUnwindSafe for ApplyError
impl Send for ApplyError
impl Sync for ApplyError
impl Unpin for ApplyError
impl UnsafeUnpin for ApplyError
impl UnwindSafe for ApplyError
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,
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.