pub enum DocumentParser {
Full {
content: String,
ast: Option<Arc<Node>>,
},
Incremental {
document: Box<IncrementalDocument>,
rope: Rope,
},
}Expand description
Wrapper for document state with incremental parsing support
Variants§
Implementations§
Source§impl DocumentParser
impl DocumentParser
Sourcepub fn new(
content: String,
config: &IncrementalConfig,
) -> Result<DocumentParser, ParseError>
pub fn new( content: String, config: &IncrementalConfig, ) -> Result<DocumentParser, ParseError>
Create a new document parser based on configuration
Sourcepub fn apply_changes(
&mut self,
changes: &[Value],
_config: &IncrementalConfig,
) -> Result<(), ParseError>
pub fn apply_changes( &mut self, changes: &[Value], _config: &IncrementalConfig, ) -> Result<(), ParseError>
Apply changes to the document
Sourcepub fn metrics(&self) -> Option<&ParseMetrics>
pub fn metrics(&self) -> Option<&ParseMetrics>
Get parsing metrics (if available)
Auto Trait Implementations§
impl Freeze for DocumentParser
impl RefUnwindSafe for DocumentParser
impl Send for DocumentParser
impl Sync for DocumentParser
impl Unpin for DocumentParser
impl UnsafeUnpin for DocumentParser
impl UnwindSafe for DocumentParser
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