Enum k2_tree::error::K2TreeError
source · [−]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
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
Produced when a user attempts to access a coordinate outside the bounds of the matrix a K2Tree represents.
StemInsertionError
Produced when a stem could not be inserted into a K2Tree’s stems.
StemRemovalError
Produced when a stem coud not be removed from a K2Tree’s stems.
LeafInsertionError
Produced when a leaf could not be inserted into a K2Tree’s leaves.
LeafRemovalError
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
source: Box<BitMatrixError>
Propogation of a BitMatrixError.
SubRangesError
Fields
source: Box<SubRangesError>
Propogation of a SubRangesError.
Trait Implementations
sourceimpl Clone for K2TreeError
impl Clone for K2TreeError
sourcefn clone(&self) -> K2TreeError
fn clone(&self) -> K2TreeError
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for K2TreeError
impl Debug for K2TreeError
sourceimpl Display for K2TreeError
impl Display for K2TreeError
sourceimpl Error for K2TreeError
impl Error for K2TreeError
sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourceimpl From<BitMatrixError> for K2TreeError
impl From<BitMatrixError> for K2TreeError
sourcefn from(error: BitMatrixError) -> Self
fn from(error: BitMatrixError) -> Self
Converts to this type from the input type.
sourceimpl From<SubRangesError> for K2TreeError
impl From<SubRangesError> for K2TreeError
sourcefn from(error: SubRangesError) -> Self
fn from(error: SubRangesError) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<K2TreeError> for K2TreeError
impl PartialEq<K2TreeError> for K2TreeError
sourcefn eq(&self, other: &K2TreeError) -> bool
fn eq(&self, other: &K2TreeError) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &K2TreeError) -> bool
fn ne(&self, other: &K2TreeError) -> bool
This method tests for !=
.
impl StructuralPartialEq for K2TreeError
Auto Trait Implementations
impl RefUnwindSafe for K2TreeError
impl Send for K2TreeError
impl Sync for K2TreeError
impl Unpin for K2TreeError
impl UnwindSafe for K2TreeError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more