Skip to main content

DocumentProcessor

Trait DocumentProcessor 

Source
pub trait DocumentProcessor {
    type Error;

    // Required method
    fn process(
        &mut self,
        state: &EditorStateManager,
    ) -> Result<Vec<ProcessingEdit>, Self::Error>;
}
Expand description

A generic processor that produces ProcessingEdits for an editor document.

Required Associated Types§

Source

type Error

The error type returned by DocumentProcessor::process.

Required Methods§

Source

fn process( &mut self, state: &EditorStateManager, ) -> Result<Vec<ProcessingEdit>, Self::Error>

Compute derived state updates to apply to the editor.

Implementations should avoid mutating state; instead, return edits that the caller can apply (e.g. via EditorStateManager::apply_processing_edits).

Implementors§