pub struct TreeError<Ix = DefaultIndexType> { /* private fields */ }
Expand description
Error type that covers the error situations that commonly occur when manipulation tree or forest operations.
TreeError
keeps a TreeErrorType
describing the error as well as a String
that can be
used to store a description of the context in which the error has occured.
Implementations§
Source§impl<Ix> TreeError<Ix>
impl<Ix> TreeError<Ix>
Sourcepub fn invalid_node_index(context: &str, node: NodeIndex<Ix>) -> Self
pub fn invalid_node_index(context: &str, node: NodeIndex<Ix>) -> Self
Construct a new TreeError
of type TreeErrorType::InvalidNodeIndex
referring to node
Sourcepub fn expected_root_node(context: &str, node: NodeIndex<Ix>) -> Self
pub fn expected_root_node(context: &str, node: NodeIndex<Ix>) -> Self
Construct a new TreeError
of type TreeErrorType::ExpectedRootNode
referring to node
Sourcepub fn expected_non_ancestor_node(
context: &str,
new_ancestor: NodeIndex<Ix>,
new_descendant: NodeIndex<Ix>,
) -> Self
pub fn expected_non_ancestor_node( context: &str, new_ancestor: NodeIndex<Ix>, new_descendant: NodeIndex<Ix>, ) -> Self
Construct a new TreeError
of type TreeErrorType::ExpectedNonAncestorNode
referring to
new_ancestor
and new_descendant
.
Sourcepub fn other_error(context: &str, msg: &str) -> Self
pub fn other_error(context: &str, msg: &str) -> Self
Construct a new TreeError
of type TreeErrorType::OtherType
with a custom message
msg
describing the particular error situation.
Trait Implementations§
Source§impl Error for TreeError
impl Error for TreeError
Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Auto Trait Implementations§
impl<Ix> Freeze for TreeError<Ix>where
Ix: Freeze,
impl<Ix> RefUnwindSafe for TreeError<Ix>where
Ix: RefUnwindSafe,
impl<Ix> Send for TreeError<Ix>where
Ix: Send,
impl<Ix> Sync for TreeError<Ix>where
Ix: Sync,
impl<Ix> Unpin for TreeError<Ix>where
Ix: Unpin,
impl<Ix> UnwindSafe for TreeError<Ix>where
Ix: UnwindSafe,
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