[][src]Enum k2_tree::error::K2TreeError

pub enum K2TreeError {
    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>,
    },
}

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

Variants

SmallStemKValue

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

Fields of SmallStemKValue

stem_k: u8
SmallLeafKValue

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

Fields of SmallLeafKValue

leaf_k: u8
TraverseError

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.

Fields of TraverseError

x: usize
y: usize
OutOfBounds

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

Fields of OutOfBounds

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

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

Fields of StemInsertionError

pos: usize

The index the stem-insertion was attempted at.

len: usize

The length of the stem.

StemRemovalError

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

Fields of StemRemovalError

pos: usize

The index the stem-removal was attempted at.

len: usize

The length of the stem.

LeafInsertionError

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

Fields of LeafInsertionError

pos: usize

The index the leaf-insertion was attempted at.

len: usize

The length of the leaf.

LeafRemovalError

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

Fields of LeafRemovalError

pos: usize

The index the leaf-removal was attempted at.

len: usize

the length of the leaf.

CouldNotShrink

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

Fields of CouldNotShrink

reason: String
CorruptedK2Tree

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

Fields of CorruptedK2Tree

source: Box<K2TreeError>
Read

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.

Fields of Read

source: Box<K2TreeError>
Write

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

Fields of Write

source: Box<K2TreeError>
BitMatrixError

Propogation of a BitMatrixError.

Fields of BitMatrixError

source: Box<BitMatrixError>
SubRangesError

Propogation of a SubRangesError.

Fields of SubRangesError

source: Box<SubRangesError>

Trait Implementations

impl Clone for K2TreeError[src]

impl Debug for K2TreeError[src]

impl Display for K2TreeError[src]

impl Error for K2TreeError[src]

impl From<BitMatrixError> for K2TreeError[src]

impl From<SubRangesError> for K2TreeError[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.