pub enum ParseNodeError {
TypeMismatch {
expected: NodeType,
actual: String,
},
NotSymbolNode {
actual: String,
},
}
Expand description
Errors that can occur during parse node validation and type checking.
This enum represents the various error conditions that can arise when working with parse nodes, particularly during type assertions and validation.
The error type implements std::error::Error
and std::fmt::Display
for proper error handling and reporting throughout the KaTeX pipeline.
§Usage
These errors are typically returned by:
assert_node_type
- When type assertion failsassert_symbol_node_type
- When symbol node assertion fails
They provide detailed information about what went wrong during node validation, helping with debugging and error reporting in parsing and rendering operations.
§Error Messages
Error messages are designed to be informative and include both the expected and actual types to aid in troubleshooting type-related issues.
Variants§
TypeMismatch
A node has an unexpected type during type checking
Fields
NotSymbolNode
A node is not one of the symbol node types
Trait Implementations§
Source§impl Debug for ParseNodeError
impl Debug for ParseNodeError
Source§impl Display for ParseNodeError
impl Display for ParseNodeError
Source§impl Error for ParseNodeError
impl Error for ParseNodeError
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
Source§impl From<ParseNodeError> for ParseError
Convert ParseNodeError to ParseError
impl From<ParseNodeError> for ParseError
Convert ParseNodeError to ParseError