pub struct PatternResult {
pub price: Option<(f32, f32)>,
pub original_price: Option<(f32, f32)>,
pub currency: Option<String>,
pub rating: Option<(f32, f32)>,
pub rating_max: Option<f32>,
pub review_count: Option<(u32, f32)>,
pub availability: Option<(f32, f32)>,
pub page_type: Option<(PageType, f32)>,
pub actions: Vec<DiscoveredAction>,
pub forms: Vec<DiscoveredForm>,
}Expand description
Result of pattern-based extraction.
Every Option field is a (value, confidence) tuple. Fields are None
when no matching pattern was found. The caller merges these results with
structured-data results, preferring whichever source has higher confidence.
Fields§
§price: Option<(f32, f32)>Extracted price as (dollar_value, confidence).
original_price: Option<(f32, f32)>Original / strike-through price as (dollar_value, confidence).
currency: Option<String>ISO 4217 currency code or symbol.
rating: Option<(f32, f32)>Rating normalized to [0.0, 1.0] as (normalized_value, confidence).
rating_max: Option<f32>Maximum rating scale detected (e.g., 5.0, 10.0).
review_count: Option<(u32, f32)>Review count as (count, confidence).
availability: Option<(f32, f32)>Availability signal: 0.0 = out of stock, 0.5 = limited,
1.0 = in stock, paired with confidence.
page_type: Option<(PageType, f32)>Detected page type and confidence.
actions: Vec<DiscoveredAction>Interactive actions found on the page.
forms: Vec<DiscoveredForm>Forms found on the page.
Trait Implementations§
Source§impl Clone for PatternResult
impl Clone for PatternResult
Source§fn clone(&self) -> PatternResult
fn clone(&self) -> PatternResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PatternResult
impl Debug for PatternResult
Source§impl Default for PatternResult
impl Default for PatternResult
Source§fn default() -> PatternResult
fn default() -> PatternResult
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PatternResult
impl RefUnwindSafe for PatternResult
impl Send for PatternResult
impl Sync for PatternResult
impl Unpin for PatternResult
impl UnsafeUnpin for PatternResult
impl UnwindSafe for PatternResult
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