pub struct ParserSession { /* private fields */ }Expand description
Incremental parser cache keyed by source path.
Implementations§
Source§impl ParserSession
impl ParserSession
Sourcepub fn split_statements(source: &str) -> Vec<StatementUnit>
pub fn split_statements(source: &str) -> Vec<StatementUnit>
Split source text into statement units with byte and line/column spans.
Sourcepub fn parse_path(
&mut self,
path: impl AsRef<Path>,
source: &str,
) -> Result<IncrementalParseResult>
pub fn parse_path( &mut self, path: impl AsRef<Path>, source: &str, ) -> Result<IncrementalParseResult>
Parse source associated with a path, reusing unchanged statement parses.
Sourcepub fn invalidate_module(&mut self, path: impl AsRef<Path>) -> usize
pub fn invalidate_module(&mut self, path: impl AsRef<Path>) -> usize
Invalidate one module path and cached sources that import it by final path segment.
Sourcepub fn cached_source_count(&self) -> usize
pub fn cached_source_count(&self) -> usize
Return the number of cached source files.
Trait Implementations§
Source§impl Debug for ParserSession
impl Debug for ParserSession
Source§impl Default for ParserSession
impl Default for ParserSession
Source§fn default() -> ParserSession
fn default() -> ParserSession
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ParserSession
impl RefUnwindSafe for ParserSession
impl Send for ParserSession
impl Sync for ParserSession
impl Unpin for ParserSession
impl UnsafeUnpin for ParserSession
impl UnwindSafe for ParserSession
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