pub struct ParseResult {
pub ast: Option<SpannedExpr>,
pub macro_calls: MacroCalls,
pub errors: Vec<ParseError>,
}Expand description
Result of parsing a CEL expression.
Supports error recovery: may return both an AST and errors.
The AST may contain Expr::Error nodes where parsing failed.
Includes macro_calls map for IDE features.
Fields§
§ast: Option<SpannedExpr>The parsed AST, if any parsing succeeded.
May contain Expr::Error nodes for unparseable sections.
Macros (has, all, exists, exists_one, map, filter) are expanded inline.
macro_calls: MacroCallsMap of comprehension/expansion IDs to original macro call expressions. Used for IDE features like hover to show the original source form.
errors: Vec<ParseError>Any parse errors encountered.
Implementations§
Source§impl ParseResult
impl ParseResult
Sourcepub fn into_result(self) -> Result<SpannedExpr, Vec<ParseError>>
pub fn into_result(self) -> Result<SpannedExpr, Vec<ParseError>>
Converts to a Result, discarding partial AST on error.
Sourcepub fn unwrap_err(self) -> Vec<ParseError>
pub fn unwrap_err(self) -> Vec<ParseError>
Unwraps the errors, panicking if there are none.
Trait Implementations§
Source§impl Clone for ParseResult
impl Clone for ParseResult
Source§fn clone(&self) -> ParseResult
fn clone(&self) -> ParseResult
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 moreAuto Trait Implementations§
impl Freeze for ParseResult
impl RefUnwindSafe for ParseResult
impl Send for ParseResult
impl Sync for ParseResult
impl Unpin for ParseResult
impl UnwindSafe for ParseResult
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