pub struct IncrementalParser { /* private fields */ }Available on crate feature
stream only.Expand description
Manages incremental parsing state and delta accumulation
Implementations§
Source§impl IncrementalParser
impl IncrementalParser
Sourcepub fn set_reparse_threshold(&mut self, threshold: usize)
pub fn set_reparse_threshold(&mut self, threshold: usize)
Set the reparse threshold in bytes
Sourcepub fn initialize_cache(&mut self, content: &str)
pub fn initialize_cache(&mut self, content: &str)
Initialize the cache with the current document content This primes the incremental parser for efficient subsequent edits
Sourcepub fn has_cached_script(&self) -> bool
pub fn has_cached_script(&self) -> bool
Check if there’s a cached script available
Sourcepub fn with_cached_script<F, R>(&self, f: F) -> Result<R>
pub fn with_cached_script<F, R>(&self, f: F) -> Result<R>
Execute a function with the cached script (avoids re-parsing)
Sourcepub fn apply_change(
&mut self,
document_text: &str,
range: Range,
new_text: &str,
) -> Result<ScriptDeltaOwned>
pub fn apply_change( &mut self, document_text: &str, range: Range, new_text: &str, ) -> Result<ScriptDeltaOwned>
Apply a change incrementally, returning the delta
Sourcepub fn full_reparse(&mut self, content: &str) -> Result<ScriptDeltaOwned>
pub fn full_reparse(&mut self, content: &str) -> Result<ScriptDeltaOwned>
Force a full reparse of the document
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear all cached state
Sourcepub fn pending_changes(&self) -> &[DocumentChange<'static>]
pub fn pending_changes(&self) -> &[DocumentChange<'static>]
Get accumulated changes since last full parse
Sourcepub fn should_reparse(&self) -> bool
pub fn should_reparse(&self) -> bool
Check if a full reparse is recommended
Trait Implementations§
Source§impl Debug for IncrementalParser
impl Debug for IncrementalParser
Auto Trait Implementations§
impl Freeze for IncrementalParser
impl RefUnwindSafe for IncrementalParser
impl Send for IncrementalParser
impl Sync for IncrementalParser
impl Unpin for IncrementalParser
impl UnwindSafe for IncrementalParser
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