pub struct CstRef<'a, 'src> { /* private fields */ }Expand description
A borrowed CST: the source, the arena and the syntax diagnostics.
Implementations§
Source§impl<'a, 'src> CstRef<'a, 'src>
impl<'a, 'src> CstRef<'a, 'src>
Sourcepub fn root(&self) -> Option<SyntaxNode<'a, 'src>>
pub fn root(&self) -> Option<SyntaxNode<'a, 'src>>
The root node (None only for a source over u32::MAX bytes, which
is rejected with crate::code::SOURCE_TOO_LONG).
Sourcepub fn diagnostics(&self) -> &'a [Diagnostic]
pub fn diagnostics(&self) -> &'a [Diagnostic]
The syntax errors, in source order of detection.
Sourcepub fn has_errors(&self) -> bool
pub fn has_errors(&self) -> bool
Whether any syntax error was reported.
Sourcepub fn tokens(
&self,
) -> impl Iterator<Item = SyntaxNode<'a, 'src>> + use<'a, 'src>
pub fn tokens( &self, ) -> impl Iterator<Item = SyntaxNode<'a, 'src>> + use<'a, 'src>
The tokens (leaves), in source order.
Trait Implementations§
impl<'a, 'src> Copy for CstRef<'a, 'src>
Auto Trait Implementations§
impl<'a, 'src> Freeze for CstRef<'a, 'src>
impl<'a, 'src> RefUnwindSafe for CstRef<'a, 'src>
impl<'a, 'src> Send for CstRef<'a, 'src>
impl<'a, 'src> Sync for CstRef<'a, 'src>
impl<'a, 'src> Unpin for CstRef<'a, 'src>
impl<'a, 'src> UnsafeUnpin for CstRef<'a, 'src>
impl<'a, 'src> UnwindSafe for CstRef<'a, 'src>
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