pub struct ParsedDocument { /* private fields */ }Expand description
Syntax produced by a language SDK before semantic extraction.
The primary tree represents the source language. Injections hold language regions embedded in opaque host nodes, such as PostgreSQL function bodies.
Implementations§
Source§impl ParsedDocument
impl ParsedDocument
pub fn new(primary: Tree) -> Self
pub fn with_injections(primary: Tree, injections: Vec<SyntaxInjection>) -> Self
pub fn primary(&self) -> &Tree
pub fn injections(&self) -> &[SyntaxInjection]
pub fn injection_for_host( &self, host_byte_range: Range<usize>, ) -> Option<&SyntaxInjection>
pub fn injection_within( &self, container_byte_range: Range<usize>, ) -> Option<&SyntaxInjection>
Auto Trait Implementations§
impl Freeze for ParsedDocument
impl RefUnwindSafe for ParsedDocument
impl Send for ParsedDocument
impl Sync for ParsedDocument
impl Unpin for ParsedDocument
impl UnsafeUnpin for ParsedDocument
impl UnwindSafe for ParsedDocument
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