pub enum KeyError {
TooShort,
NotFound,
TooLong,
}
Expand description
Errors that can occur when using the Tree traits.
A usize
member indicates the key depth where the error occurred.
The depth here is the number of names or indices consumed.
It is also the number of separators in a path or the length
of an indices slice.
If multiple errors are applicable simultaneously the precedence is as per the order in the enum definition (from high to low).
Variants§
TooShort
The key ends early and does not reach a leaf node.
NotFound
The key was not found (index parse failure or too large, name not found or invalid).
TooLong
The key is too long and goes beyond a leaf node.
Trait Implementations§
Source§impl Error for KeyError
impl Error for KeyError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl<E> From<KeyError> for DescendError<E>
impl<E> From<KeyError> for DescendError<E>
Source§impl<E> From<KeyError> for SerdeError<E>
impl<E> From<KeyError> for SerdeError<E>
Source§impl From<KeyError> for ValueError
impl From<KeyError> for ValueError
Source§impl<E> TryFrom<DescendError<E>> for KeyError
impl<E> TryFrom<DescendError<E>> for KeyError
Source§impl<E> TryFrom<SerdeError<E>> for KeyError
impl<E> TryFrom<SerdeError<E>> for KeyError
Source§type Error = SerdeError<E>
type Error = SerdeError<E>
The type returned in the event of a conversion error.
Source§impl TryFrom<ValueError> for KeyError
impl TryFrom<ValueError> for KeyError
Source§type Error = ValueError
type Error = ValueError
The type returned in the event of a conversion error.
impl Copy for KeyError
impl Eq for KeyError
impl StructuralPartialEq for KeyError
Auto Trait Implementations§
impl Freeze for KeyError
impl RefUnwindSafe for KeyError
impl Send for KeyError
impl Sync for KeyError
impl Unpin for KeyError
impl UnwindSafe for KeyError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more