pub struct ExtractionEngine;Expand description
Extraction engine: executes templates against HTML
Uses the scraper crate to evaluate CSS selectors against HTML,
applies transformations, and builds structured results.
Implementations§
Source§impl ExtractionEngine
impl ExtractionEngine
Sourcepub fn execute(request: &ExtractionRequest) -> Result<ExtractionResult>
pub fn execute(request: &ExtractionRequest) -> Result<ExtractionResult>
Execute an extraction request
§Errors
Returns crate::error::PluginError::TemplateValidationError when
the embedded template fails validation. Returns
crate::error::PluginError::ExtractionError when the request URL
or HTML payload is empty, or a region selector matches no elements.
Per-region extraction errors are captured as RegionStatus::error
entries on the returned ExtractionResult rather than returned
directly — only the first hard failure short-circuits the result.
pub fn diagnose( request: &ExtractionRequest, evaluation_scope: &str, ) -> ExtractionDebugInfo
Trait Implementations§
Source§impl PluginExtractionPort for ExtractionEngine
impl PluginExtractionPort for ExtractionEngine
Source§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,
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
Source§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,
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
Auto Trait Implementations§
impl Freeze for ExtractionEngine
impl RefUnwindSafe for ExtractionEngine
impl Send for ExtractionEngine
impl Sync for ExtractionEngine
impl Unpin for ExtractionEngine
impl UnsafeUnpin for ExtractionEngine
impl UnwindSafe for ExtractionEngine
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