pub struct Parse<T> { /* private fields */ }Expand description
The result of parsing: a syntax tree and a collection of errors.
This type is designed to be stored in Salsa databases as it contains
the thread-safe GreenNode instead of the non-thread-safe SyntaxNode.
Implementations§
Source§impl<T> Parse<T>
impl<T> Parse<T>
Sourcepub fn new(green: GreenNode, errors: Vec<ErrorInfo>) -> Self
pub fn new(green: GreenNode, errors: Vec<ErrorInfo>) -> Self
Create a new Parse result from a GreenNode and errors
Sourcepub fn to_result(self) -> Result<T, Error>
pub fn to_result(self) -> Result<T, Error>
Convert to a Result, returning the tree if there are no errors
Sourcepub fn tree(&self) -> T
pub fn tree(&self) -> T
Get the parsed syntax tree
Returns the tree even if there are parse errors. Use errors() or ok() to check
for errors separately if needed.
Sourcepub fn syntax_node(&self) -> SyntaxNode<Lang>
pub fn syntax_node(&self) -> SyntaxNode<Lang>
Get the syntax node
Trait Implementations§
impl<T: Eq> Eq for Parse<T>
impl<T> Send for Parse<T>
impl<T> StructuralPartialEq for Parse<T>
impl<T> Sync for Parse<T>
Auto Trait Implementations§
impl<T> Freeze for Parse<T>
impl<T> RefUnwindSafe for Parse<T>where
T: RefUnwindSafe,
impl<T> Unpin for Parse<T>where
T: Unpin,
impl<T> UnwindSafe for Parse<T>where
T: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)