pub enum ViewConstructionError<T, Nt, E = Infallible> {
UnexpectedNode {
node: CstNodeId,
data: CstNodeData<T, Nt>,
expected_kind: NodeKind<T, Nt>,
},
UnexpectedExtraNode {
node: CstNodeId,
},
UnexpectedEndOfChildren {
parent: CstNodeId,
},
UnexpectedEmptyChildren {
node: CstNodeId,
},
NodeIdNotFound {
node: CstNodeId,
},
Error(E),
}Expand description
Error that occurs when constructing a view from a NonTerminalHandle.
Variants§
UnexpectedNode
Expected a specific kind of terminal node, but got an invalid node
Fields
§
data: CstNodeData<T, Nt>The data of the node.
UnexpectedExtraNode
Expected an extra node, but got an invalid node
UnexpectedEndOfChildren
Unexpected end of children
UnexpectedEmptyChildren
Unexpected empty children for a non-terminal
NodeIdNotFound
The node ID not found in the tree
Error(E)
Error that occurs when constructing a view from a NonTerminalHandle.
Implementations§
Source§impl<T, Nt, E> ViewConstructionError<T, Nt, E>
impl<T, Nt, E> ViewConstructionError<T, Nt, E>
pub fn extract_error( self, ) -> Result<E, ViewConstructionError<T, Nt, Infallible>>
Source§impl<T, Nt> ViewConstructionError<T, Nt, Infallible>
impl<T, Nt> ViewConstructionError<T, Nt, Infallible>
pub fn into_any_error<E>(self) -> ViewConstructionError<T, Nt, E>
Source§impl<T, Nt> ViewConstructionError<T, Nt, Infallible>
impl<T, Nt> ViewConstructionError<T, Nt, Infallible>
pub fn unexpected_node(&self) -> Option<UnexpectedNode<T, Nt>>
Trait Implementations§
Source§impl<T: Clone, Nt: Clone, E: Clone> Clone for ViewConstructionError<T, Nt, E>
impl<T: Clone, Nt: Clone, E: Clone> Clone for ViewConstructionError<T, Nt, E>
Source§fn clone(&self) -> ViewConstructionError<T, Nt, E>
fn clone(&self) -> ViewConstructionError<T, Nt, E>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T, Nt, E> Display for ViewConstructionError<T, Nt, E>
impl<T, Nt, E> Display for ViewConstructionError<T, Nt, E>
Source§impl<T, Nt, E> Error for ViewConstructionError<T, Nt, E>
impl<T, Nt, E> Error for ViewConstructionError<T, Nt, E>
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()
Auto Trait Implementations§
impl<T, Nt, E> Freeze for ViewConstructionError<T, Nt, E>
impl<T, Nt, E> RefUnwindSafe for ViewConstructionError<T, Nt, E>
impl<T, Nt, E> Send for ViewConstructionError<T, Nt, E>
impl<T, Nt, E> Sync for ViewConstructionError<T, Nt, E>
impl<T, Nt, E> Unpin for ViewConstructionError<T, Nt, E>
impl<T, Nt, E> UnwindSafe for ViewConstructionError<T, Nt, E>
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