pub trait PluginExtractionPort: Send + Sync {
// Required method
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ExtractionRequest,
) -> Pin<Box<dyn Future<Output = Result<ExtractionResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided method
fn validate_selector<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_html: &'life1 str,
_selector_expr: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(bool, usize)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
}Expand description
Port for executing data extraction on a page
Implementations handle DOM interaction (via browser automation or plugin content script).
§Example
use stygian_plugin::ports::PluginExtractionPort;
use stygian_plugin::domain::{ExtractionRequest, ExtractionTemplate};
let template = ExtractionTemplate::new("Example");
let request = ExtractionRequest::new(template, "https://example.com", "<html>...</html>");
let result = port.execute(&request).await?;Required Methods§
Sourcefn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ExtractionRequest,
) -> Pin<Box<dyn Future<Output = Result<ExtractionResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ExtractionRequest,
) -> Pin<Box<dyn Future<Output = Result<ExtractionResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute extraction using a request
Provided Methods§
Sourcefn validate_selector<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_html: &'life1 str,
_selector_expr: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(bool, usize)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn validate_selector<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_html: &'life1 str,
_selector_expr: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(bool, usize)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Validate a selector against the current/provided DOM
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".