pub struct ParserResult<'a> {
pub root: &'a Node<'a>,
pub is_complete: bool,
pub metadata: Option<HashMap<usize, NodeMetadata, BuildNoHashHasher<usize>>>,
}Expand description
语法分析结果结构体 包含解析生成的AST根节点和相关元数据
Fields§
§root: &'a Node<'a>§is_complete: bool§metadata: Option<HashMap<usize, NodeMetadata, BuildNoHashHasher<usize>>>Implementations§
Source§impl<'a> ParserResult<'a>
impl<'a> ParserResult<'a>
Sourcepub fn error(&self) -> Result<(), ParserError>
pub fn error(&self) -> Result<(), ParserError>
检查解析结果是否包含错误 返回第一个遇到的错误,如果没有错误则返回Ok(())
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ParserResult<'a>
impl<'a> RefUnwindSafe for ParserResult<'a>
impl<'a> Send for ParserResult<'a>
impl<'a> Sync for ParserResult<'a>
impl<'a> Unpin for ParserResult<'a>
impl<'a> UnwindSafe for ParserResult<'a>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more