pub struct ValidatedTree<Grammar> { /* private fields */ }Expand description
A completed, syntax-clean parse tree whose generated child cardinalities have been structurally validated.
Constructed only by a generated parser’s validate() /
parse_validated() conveniences after validate_tree_structure proved
the required-child invariants, so ValidatedTree::tree and the
validated context accessors never observe a violated invariant. Grammar
is the generated module’s ValidatedTreeContext marker; it keeps the
validated trees of different grammars nominally distinct.
Implementations§
Source§impl<Grammar> ValidatedTree<Grammar>
impl<Grammar> ValidatedTree<Grammar>
Sourcepub fn tree(&self) -> ValidatedRuleNode<'_, Grammar>
pub fn tree(&self) -> ValidatedRuleNode<'_, Grammar>
Returns the validated entry-rule root.
Sourcepub const fn parsed_file(&self) -> &ParsedFile
pub const fn parsed_file(&self) -> &ParsedFile
Borrows the underlying recovery-oriented parsed file.
Sourcepub fn into_parsed_file(self) -> ParsedFile
pub fn into_parsed_file(self) -> ParsedFile
Drops the validation type boundary and returns the underlying parsed file.
Trait Implementations§
Auto Trait Implementations§
impl<Grammar> !RefUnwindSafe for ValidatedTree<Grammar>
impl<Grammar> !Send for ValidatedTree<Grammar>
impl<Grammar> !Sync for ValidatedTree<Grammar>
impl<Grammar> !UnwindSafe for ValidatedTree<Grammar>
impl<Grammar> Freeze for ValidatedTree<Grammar>
impl<Grammar> Unpin for ValidatedTree<Grammar>where
Grammar: Unpin,
impl<Grammar> UnsafeUnpin for ValidatedTree<Grammar>
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