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
WrongParent
A segment appears in the list of a shape that does not own it.
Fields
SegmentInTwoLists
The same segment is reachable from two shapes’ heads.
AsymmetricLink
a.next == b without b.prev == a, or the mirror of that.
Fields
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.
CountMismatch
A shape’s recorded segment count is not the length of its list.
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.
OffsetDisagreesWithPoint
A segment’s recorded offset is not the offset of the point it starts at.
MissingFromIndex
A live segment is missing from the shared-start index.
DanglingIndexEntry
The shared-start index refers to a segment that is not in the arena.
MisfiledIndexEntry
The shared-start index files a segment under a point it does not start at.
DuplicateIndexEntry
The shared-start index lists the same segment twice under one point.
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.
IndexSizeMismatch
The index holds a different number of segments from the arena.
CoveredByMissingShape
A segment is marked as covered by a shape that no longer exists, which would keep it invisible for ever.
ShapeCoversItself
A shape is marked as covering part of its own outline.
Trait Implementations§
Source§impl Clone for StructureError
impl Clone for StructureError
Source§fn clone(&self) -> StructureError
fn clone(&self) -> StructureError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for StructureError
Source§impl Debug for StructureError
impl Debug for StructureError
Source§impl Display for StructureError
impl Display for StructureError
impl Eq for StructureError
Source§impl Error for StructureError
impl Error for StructureError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()