Skip to main content

ApplyError

Enum ApplyError 

Source
pub enum ApplyError {
Show 16 variants MarkOutOfRange { start: Usv, end: Usv, len: Usv, }, LineOutOfRange { line: usize, lines: usize, }, SplitPositionOutOfRange { at: Usv, len: Usv, }, SplitAtNewline { at: Usv, }, LineCountMismatch { lines: usize, segments: usize, }, DeltaBaseMismatch { expected: usize, actual: usize, }, IslandSlotInInsert, AnchorIdCollision { id: String, }, EmptyAnchorId, UnknownIslandId { id: String, }, IslandIdCollision { id: String, }, EmptyIslandId, IslandInsertOutOfRange { at: Usv, len: Usv, }, BlockIslandNotAlone { at: Usv, }, NestingTooDeep { line: usize, depth: usize, max: usize, }, BadHeadingLevel { line: usize, level: u8, },
}
Expand description

Why an apply failed: range or line index out of bounds, or invariants broken before normalization could repair them.

Variants§

§

MarkOutOfRange

Fields

§start: Usv
§end: Usv
§len: Usv
§

LineOutOfRange

Fields

§line: usize
§lines: usize
§

SplitPositionOutOfRange

Fields

§at: Usv
§len: Usv
§

SplitAtNewline

Fields

§at: Usv
§

LineCountMismatch

Fields

§lines: usize
§segments: usize
§

DeltaBaseMismatch

The text delta’s expected base length disagreed with the content: it was built against a different revision.

Fields

§expected: usize
§actual: usize
§

IslandSlotInInsert

An Op::Insert carried a raw ISLAND_SLOT, which would leave a slot with no backing Island. Islands are created through IslandOp::Insert, never a text splice, so a whole-field splice carrying slots must be split into a slot-stripped delta plus one IslandOp::Insert per slot.

§

AnchorIdCollision

A MarkOp::Add of an anchor whose id is already live in the field. Rejected rather than replaced (which would retarget a live thread) or coexisting (which RemoveAnchor cannot disambiguate).

Fields

§

EmptyAnchorId

A MarkOp::Add of an anchor with the empty id.

§

UnknownIslandId

An IslandOp::Set naming an id no island in the field carries.

Fields

§

IslandIdCollision

An IslandOp::Insert whose id is already live in the field. Set addresses by id, so a duplicate is an island neither op can name.

Fields

§

EmptyIslandId

An IslandOp::Insert carrying the empty id.

§

IslandInsertOutOfRange

An IslandOp::Insert whose at is past the end of the text the delta and this bundle’s earlier island ops left.

Fields

§at: Usv
§len: Usv
§

BlockIslandNotAlone

An island op would leave a block-only island’s slot (IslandType::block_only, a table) sharing its line with other content. Markdown writes such an island by breaking the line around it, so the op that lands one mid-line is refused rather than restructuring the author’s blocks. at is the slot’s position.

Fields

§at: Usv
§

NestingTooDeep

A LineOp::SetContainers nested a line deeper than MAX_NESTING_DEPTH.

Fields

§line: usize
§depth: usize
§max: usize
§

BadHeadingLevel

A LineOp::SetKind naming a heading level outside 1..=6. Refused because normalize does not repair it: the level reaches export as that many #, which CommonMark reads back as a literal-hash paragraph.

Fields

§line: usize
§level: u8

Trait Implementations§

Source§

impl Clone for ApplyError

Source§

fn clone(&self) -> ApplyError

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 ApplyError

Source§

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

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

impl Eq for ApplyError

Source§

impl PartialEq for ApplyError

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ApplyError

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<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<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> 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.