pub struct CstDocument { /* private fields */ }Expand description
The parsed, lossless concrete syntax tree of a RON document.
Holds the green root, any diagnostics produced during parsing (empty for well-formed input; populated by error recovery), and the byte length of the accepted source. Round-trip identity (INV-2/INV-3): concatenating all token texts under the root equals the original source bytes, for valid and error-recovered trees.
Implementations§
Source§impl CstDocument
impl CstDocument
Sourcepub fn root(&self) -> SyntaxNode
pub fn root(&self) -> SyntaxNode
The root SyntaxNode of the tree.
Sourcepub fn diagnostics(&self) -> &[Diagnostic]
pub fn diagnostics(&self) -> &[Diagnostic]
Diagnostics produced during parsing (empty for well-formed input).
Deterministic (INV-6): identical input yields an identical diagnostics set — same codes, order, and byte ranges — including recovery and over-limit diagnostics.
Sourcepub fn source_len(&self) -> usize
pub fn source_len(&self) -> usize
Byte length of the accepted source.
Trait Implementations§
Source§impl Clone for CstDocument
impl Clone for CstDocument
Source§fn clone(&self) -> CstDocument
fn clone(&self) -> CstDocument
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 CstDocument
impl RefUnwindSafe for CstDocument
impl Send for CstDocument
impl Sync for CstDocument
impl Unpin for CstDocument
impl UnsafeUnpin for CstDocument
impl UnwindSafe for CstDocument
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