pub struct CachingParseSession<L: Language + Send + Sync + 'static, C: ParseCache<L>> { /* private fields */ }Expand description
A ParseCache implementation that wraps another ParseCache and adds content-based caching.
Implementations§
Source§impl<L: Language + Send + Sync + 'static, C: ParseCache<L>> CachingParseSession<L, C>
impl<L: Language + Send + Sync + 'static, C: ParseCache<L>> CachingParseSession<L, C>
Sourcepub fn content_cache(&self) -> &ContentCache<L>
pub fn content_cache(&self) -> &ContentCache<L>
Returns a reference to the content cache.
Sourcepub fn content_cache_mut(&mut self) -> &mut ContentCache<L>
pub fn content_cache_mut(&mut self) -> &mut ContentCache<L>
Returns a mutable reference to the content cache.
Trait Implementations§
Source§impl<L: Language + Send + Sync + 'static, C: ParseCache<L> + BuilderCache<L>> BuilderCache<L> for CachingParseSession<L, C>
Implementation of BuilderCache for CachingParseSession.
impl<L: Language + Send + Sync + 'static, C: ParseCache<L> + BuilderCache<L>> BuilderCache<L> for CachingParseSession<L, C>
Implementation of BuilderCache for CachingParseSession.
Source§impl<L: Language + Send + Sync + 'static, C: ParseCache<L>> LexerCache<L> for CachingParseSession<L, C>
impl<L: Language + Send + Sync + 'static, C: ParseCache<L>> LexerCache<L> for CachingParseSession<L, C>
Source§fn set_lex_output(&mut self, output: LexOutput<L>)
fn set_lex_output(&mut self, output: LexOutput<L>)
Sets the lexed output in the cache. Read more
Source§fn get_token(&self, index: usize) -> Option<Token<L::TokenType>>
fn get_token(&self, index: usize) -> Option<Token<L::TokenType>>
Gets a token from the cache by index. Read more
Source§fn count_tokens(&self) -> usize
fn count_tokens(&self) -> usize
Gets the total number of tokens in the cache. Read more
Source§fn has_tokens(&self) -> bool
fn has_tokens(&self) -> bool
Checks if the cache contains any tokens. Read more
Source§impl<L: Language + Send + Sync + 'static, C: ParseCache<L>> ParseCache<L> for CachingParseSession<L, C>
impl<L: Language + Send + Sync + 'static, C: ParseCache<L>> ParseCache<L> for CachingParseSession<L, C>
Source§fn arena(&self) -> &SyntaxArena
fn arena(&self) -> &SyntaxArena
Returns the arena for allocating nodes in the current generation.
Source§fn old_tree(&self) -> Option<&GreenNode<'_, L>>
fn old_tree(&self) -> Option<&GreenNode<'_, L>>
Returns the root of the previous tree for incremental parsing.
Source§fn lex_output(&self) -> Option<&LexOutput<L>>
fn lex_output(&self) -> Option<&LexOutput<L>>
Returns the output of the lexing phase.
Source§fn prepare_generation(&mut self)
fn prepare_generation(&mut self)
Prepares for a new parsing generation (e.g. by swapping arenas).
Source§fn commit_generation(&self, root: &GreenNode<'_, L>)
fn commit_generation(&self, root: &GreenNode<'_, L>)
Commits the result of a parsing generation.
Auto Trait Implementations§
impl<L, C> Freeze for CachingParseSession<L, C>where
C: Freeze,
impl<L, C> !RefUnwindSafe for CachingParseSession<L, C>
impl<L, C> Send for CachingParseSession<L, C>where
C: Send,
impl<L, C> Sync for CachingParseSession<L, C>where
C: Sync,
impl<L, C> Unpin for CachingParseSession<L, C>where
C: Unpin,
impl<L, C> UnsafeUnpin for CachingParseSession<L, C>where
C: UnsafeUnpin,
impl<L, C> !UnwindSafe for CachingParseSession<L, C>
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