Skip to main content

AstPlugin

Trait AstPlugin 

Source
pub trait AstPlugin: Send + Sync {
    // Required methods
    fn metadata(&self) -> &PluginMetadata;
    fn clone_plugin(&self) -> Box<dyn AstPlugin>;

    // Provided methods
    fn initialize(&mut self, context: &mut PluginContext) -> PluginResult { ... }
    fn process_node(
        &self,
        node: &mut AstNode,
        context: &mut PluginContext,
    ) -> PluginResult { ... }
    fn process_document(
        &self,
        document: &mut PdfDocument,
        context: &mut PluginContext,
    ) -> PluginResult { ... }
    fn finalize(&self, context: &mut PluginContext) -> PluginResult { ... }
    fn config_schema(&self) -> Option<Value> { ... }
    fn set_config(&mut self, config: Value) -> PluginResult { ... }
    fn can_process_node_type(&self, node_type: &NodeType) -> bool { ... }
    fn capabilities(&self) -> PluginCapabilities { ... }
}
Expand description

Base trait for all plugins

Required Methods§

Source

fn metadata(&self) -> &PluginMetadata

Get plugin metadata

Source

fn clone_plugin(&self) -> Box<dyn AstPlugin>

Clone the plugin (for plugin instances)

Provided Methods§

Source

fn initialize(&mut self, context: &mut PluginContext) -> PluginResult

Initialize the plugin

Source

fn process_node( &self, node: &mut AstNode, context: &mut PluginContext, ) -> PluginResult

Process a single node

Source

fn process_document( &self, document: &mut PdfDocument, context: &mut PluginContext, ) -> PluginResult

Process the entire document

Source

fn finalize(&self, context: &mut PluginContext) -> PluginResult

Finalize processing

Source

fn config_schema(&self) -> Option<Value>

Get plugin configuration schema

Source

fn set_config(&mut self, config: Value) -> PluginResult

Set plugin configuration

Source

fn can_process_node_type(&self, node_type: &NodeType) -> bool

Check if plugin can process specific node type

Source

fn capabilities(&self) -> PluginCapabilities

Get plugin capabilities

Implementors§