pub enum K2TreeError {
Show 14 variants SmallStemKValue { stem_k: u8, }, SmallLeafKValue { leaf_k: u8, }, TraverseError { x: usize, y: usize, }, OutOfBounds { x_y: [usize; 2], min_x_y: [usize; 2], max_x_y: [usize; 2], }, StemInsertionError { pos: usize, len: usize, }, StemRemovalError { pos: usize, len: usize, }, LeafInsertionError { pos: usize, len: usize, }, LeafRemovalError { pos: usize, len: usize, }, CouldNotShrink { reason: String, }, CorruptedK2Tree { source: Box<K2TreeError>, }, Read { source: Box<K2TreeError>, }, Write { source: Box<K2TreeError>, }, BitMatrixError { source: Box<BitMatrixError>, }, SubRangesError { source: Box<SubRangesError>, },
}
Expand description

Errors produced as a result of interactions with the K2Tree object.

Variants

SmallStemKValue

Fields

stem_k: u8

Produced when a user attempts to create a K2Tree with a k values below 2.

SmallLeafKValue

Fields

leaf_k: u8

Produced when a user attempts to create a K2Tree with a k values below 2.

TraverseError

Fields

x: usize
y: usize

Produced when a problem occurs attempting to traverse a K2Tree.

This mostly appears because the internal state of K2Tree is corrupted, or the user found a way to search for an invalid coordinate within the bounds of the matrix the K2Tree represents.

OutOfBounds

Fields

min_x_y: [usize; 2]
max_x_y: [usize; 2]

Produced when a user attempts to access a coordinate outside the bounds of the matrix a K2Tree represents.

StemInsertionError

Fields

pos: usize

The index the stem-insertion was attempted at.

len: usize

The length of the stem.

Produced when a stem could not be inserted into a K2Tree’s stems.

StemRemovalError

Fields

pos: usize

The index the stem-removal was attempted at.

len: usize

The length of the stem.

Produced when a stem coud not be removed from a K2Tree’s stems.

LeafInsertionError

Fields

pos: usize

The index the leaf-insertion was attempted at.

len: usize

The length of the leaf.

Produced when a leaf could not be inserted into a K2Tree’s leaves.

LeafRemovalError

Fields

pos: usize

The index the leaf-removal was attempted at.

len: usize

the length of the leaf.

Produced when a leaf could not be removed from a K2Tree’s leaves.

CouldNotShrink

Fields

reason: String

Produced when a problem occurs attempting to shrink the matrix a K2Tree represents.

CorruptedK2Tree

Fields

source: Box<K2TreeError>

Indicates that the source error resulted in the corruption of a K2Tree.

Read

Fields

source: Box<K2TreeError>

Indicates that the source error was produced during a read operation on a K2Tree.

Almost certainly guarantees that the error did not cause any corruption.

Write

Fields

source: Box<K2TreeError>

Indicates that the source error was produced during a write operation on a K2Tree.

BitMatrixError

Fields

Propogation of a BitMatrixError.

SubRangesError

Fields

Propogation of a SubRangesError.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Converts to this type from the input type.

Converts to this type from the input type.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.