pub enum ReconstructError {
WrongNode {
expected: &'static str,
expected_named: bool,
actual: String,
actual_named: bool,
},
WrongCategory {
category: &'static str,
actual: String,
actual_named: bool,
},
MissingField {
node: String,
field: &'static str,
},
MissingChild {
node: String,
expected: &'static str,
},
InvalidPunctuated {
node: String,
values: usize,
punctuation: usize,
},
}Expand description
A typed reconstruction failure.
Variants§
WrongNode
A concrete typed node received the wrong backend node kind.
Fields
WrongCategory
No alternative in a typed category matched the backend node.
Fields
MissingField
A required named field was absent.
MissingChild
A required positional or anonymous child was absent.
Fields
InvalidPunctuated
A punctuated field was empty or did not contain one separator between every adjacent pair of values.
Implementations§
Source§impl ReconstructError
impl ReconstructError
Sourcepub fn wrong_node(
expected: &'static str,
expected_named: bool,
actual: CSTNodeClassLabel<'_>,
) -> Self
pub fn wrong_node( expected: &'static str, expected_named: bool, actual: CSTNodeClassLabel<'_>, ) -> Self
Creates a concrete node-kind mismatch.
Sourcepub fn wrong_category(
category: &'static str,
actual: CSTNodeClassLabel<'_>,
) -> Self
pub fn wrong_category( category: &'static str, actual: CSTNodeClassLabel<'_>, ) -> Self
Creates a category mismatch.
Trait Implementations§
Source§impl Clone for ReconstructError
impl Clone for ReconstructError
Source§fn clone(&self) -> ReconstructError
fn clone(&self) -> ReconstructError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReconstructError
impl Debug for ReconstructError
Source§impl Display for ReconstructError
impl Display for ReconstructError
impl Eq for ReconstructError
Source§impl Error for ReconstructError
impl Error for ReconstructError
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 From<ReconstructError> for ParseError
impl From<ReconstructError> for ParseError
Source§fn from(error: ReconstructError) -> Self
fn from(error: ReconstructError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ReconstructError
impl PartialEq for ReconstructError
impl StructuralPartialEq for ReconstructError
Auto Trait Implementations§
impl Freeze for ReconstructError
impl RefUnwindSafe for ReconstructError
impl Send for ReconstructError
impl Sync for ReconstructError
impl Unpin for ReconstructError
impl UnsafeUnpin for ReconstructError
impl UnwindSafe for ReconstructError
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