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§
Sourcefn metadata(&self) -> &PluginMetadata
fn metadata(&self) -> &PluginMetadata
Get plugin metadata
Sourcefn clone_plugin(&self) -> Box<dyn AstPlugin>
fn clone_plugin(&self) -> Box<dyn AstPlugin>
Clone the plugin (for plugin instances)
Provided Methods§
Sourcefn initialize(&mut self, context: &mut PluginContext) -> PluginResult
fn initialize(&mut self, context: &mut PluginContext) -> PluginResult
Initialize the plugin
Sourcefn process_node(
&self,
node: &mut AstNode,
context: &mut PluginContext,
) -> PluginResult
fn process_node( &self, node: &mut AstNode, context: &mut PluginContext, ) -> PluginResult
Process a single node
Sourcefn process_document(
&self,
document: &mut PdfDocument,
context: &mut PluginContext,
) -> PluginResult
fn process_document( &self, document: &mut PdfDocument, context: &mut PluginContext, ) -> PluginResult
Process the entire document
Sourcefn finalize(&self, context: &mut PluginContext) -> PluginResult
fn finalize(&self, context: &mut PluginContext) -> PluginResult
Finalize processing
Sourcefn config_schema(&self) -> Option<Value>
fn config_schema(&self) -> Option<Value>
Get plugin configuration schema
Sourcefn set_config(&mut self, config: Value) -> PluginResult
fn set_config(&mut self, config: Value) -> PluginResult
Set plugin configuration
Sourcefn can_process_node_type(&self, node_type: &NodeType) -> bool
fn can_process_node_type(&self, node_type: &NodeType) -> bool
Check if plugin can process specific node type
Sourcefn capabilities(&self) -> PluginCapabilities
fn capabilities(&self) -> PluginCapabilities
Get plugin capabilities