Skip to main content

StructureError

Enum StructureError 

Source
pub enum StructureError {
Show 17 variants DanglingSegment { shape: ShapeId, segment: SegId, }, WrongParent { shape: ShapeId, segment: SegId, owner: ShapeId, }, SegmentInTwoLists { segment: SegId, }, AsymmetricLink { from: SegId, to: SegId, }, WalkOverran { shape: ShapeId, bound: usize, }, CountMismatch { shape: ShapeId, recorded: usize, walked: usize, }, OffsetsOutOfOrder { shape: ShapeId, }, OffsetDisagreesWithPoint { segment: SegId, }, MissingFromIndex { segment: SegId, }, DanglingIndexEntry { segment: SegId, }, MisfiledIndexEntry { segment: SegId, }, DuplicateIndexEntry { segment: SegId, }, EmptyIndexEntry, UnreachableSegment { segment: SegId, }, IndexSizeMismatch { indexed: usize, live: usize, }, CoveredByMissingShape { segment: SegId, shape: ShapeId, }, ShapeCoversItself { shape: ShapeId, },
}
Expand description

Something the clipping structure guarantees, found not to hold.

Every variant is a bug in whatever last mutated the structure. None of them is reachable from user input: a move that cannot be played is rejected long before it reaches this layer.

Variants§

§

DanglingSegment

A list links to a segment that is not in the arena.

Fields

§shape: ShapeId

The shape whose list holds the broken link.

§segment: SegId

The segment that is not there.

§

WrongParent

A segment appears in the list of a shape that does not own it.

Fields

§shape: ShapeId

The shape whose list it turned up in.

§segment: SegId

The segment.

§owner: ShapeId

The shape it says it belongs to.

§

SegmentInTwoLists

The same segment is reachable from two shapes’ heads.

Fields

§segment: SegId

The segment.

a.next == b without b.prev == a, or the mirror of that.

Fields

§from: SegId

The segment whose next points at to.

§to: SegId

The segment whose prev should point back at from.

§

WalkOverran

Walking from a shape’s head did not return to it within the shape’s recorded segment count — the list has a cycle that misses the head, or the count is wrong.

Fields

§shape: ShapeId

The shape.

§bound: usize

The count the walk was bounded by.

§

CountMismatch

A shape’s recorded segment count is not the length of its list.

Fields

§shape: ShapeId

The shape.

§recorded: usize

What it says.

§walked: usize

What the walk found.

§

OffsetsOutOfOrder

Offsets do not ascend round the list, allowing for one wraparound — and for an open shape, allowing for it only at the wrap itself.

Fields

§shape: ShapeId

The shape.

§

OffsetDisagreesWithPoint

A segment’s recorded offset is not the offset of the point it starts at.

Fields

§segment: SegId

The segment.

§

MissingFromIndex

A live segment is missing from the shared-start index.

Fields

§segment: SegId

The segment.

§

DanglingIndexEntry

The shared-start index refers to a segment that is not in the arena.

Fields

§segment: SegId

The segment that is not there.

§

MisfiledIndexEntry

The shared-start index files a segment under a point it does not start at.

Fields

§segment: SegId

The segment.

§

DuplicateIndexEntry

The shared-start index lists the same segment twice under one point.

Fields

§segment: SegId

The segment.

§

EmptyIndexEntry

A point is in the shared-start index with nothing starting there.

§

UnreachableSegment

A segment is alive in the arena but no shape’s list reaches it.

Fields

§segment: SegId

The segment.

§

IndexSizeMismatch

The index holds a different number of segments from the arena.

Fields

§indexed: usize

How many the index holds.

§live: usize

How many are in the arena.

§

CoveredByMissingShape

A segment is marked as covered by a shape that no longer exists, which would keep it invisible for ever.

Fields

§segment: SegId

The segment.

§shape: ShapeId

The shape that is gone.

§

ShapeCoversItself

A shape is marked as covering part of its own outline.

Fields

§shape: ShapeId

The shape.

Trait Implementations§

Source§

impl Clone for StructureError

Source§

fn clone(&self) -> StructureError

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 Copy for StructureError

Source§

impl Debug for StructureError

Source§

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

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

impl Display for StructureError

Source§

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

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

impl Eq for StructureError

Source§

impl Error for StructureError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<StructureError> for ZoneError

Source§

fn from(source: StructureError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for StructureError

Source§

fn eq(&self, other: &StructureError) -> 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 StructureError

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<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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.