pub enum Traversal {
Absent(usize),
TooShort(usize),
NotFound(usize),
TooLong(usize),
Access(usize, &'static str),
Invalid(usize, &'static str),
}
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§
Absent(usize)
A node does not exist at runtime.
An enum
variant in the tree towards the node is currently absent.
This is for example the case if an Option
using the Tree*
traits is None
at runtime. See also crate::TreeKey
.
TooShort(usize)
The key ends early and does not reach a leaf node.
NotFound(usize)
The key was not found (index parse failure or too large, name not found or invalid).
TooLong(usize)
The key is too long and goes beyond a leaf node.
Access(usize, &'static str)
A node could not be accessed.
The get
or get_mut
accessor returned an error message.
Invalid(usize, &'static str)
A deserialized leaf value was found to be invalid.
The validate
callback returned an error message.
Implementations§
Trait Implementations§
source§impl Error for Traversal
impl Error for Traversal
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
impl Copy for Traversal
impl Eq for Traversal
impl StructuralPartialEq for Traversal
Auto Trait Implementations§
impl Freeze for Traversal
impl RefUnwindSafe for Traversal
impl Send for Traversal
impl Sync for Traversal
impl Unpin for Traversal
impl UnwindSafe for Traversal
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)