pub struct Region {
pub name: String,
pub selector: Selector,
pub schema: Value,
pub transformations: Vec<Transformation>,
}Expand description
A named region within a template to extract data from
Each region represents a distinct zone on the page with its own selectors and transformations.
§Example
use stygian_plugin::domain::Region;
use stygian_plugin::domain::Selector;
let region = Region {
name: "product-title".to_string(),
selector: Selector::css(".product-name".to_string()),
schema: serde_json::json!({"type": "string"}),
transformations: vec![],
};Fields§
§name: StringRegion name (e.g., “product-title”, “price”, “rating”)
selector: SelectorPrimary selector (CSS or XPath) to locate the element
schema: ValueJSON schema describing the expected output shape
transformations: Vec<Transformation>Ordered transformations to apply to extracted values
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Region
impl<'de> Deserialize<'de> for Region
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Region
impl RefUnwindSafe for Region
impl Send for Region
impl Sync for Region
impl Unpin for Region
impl UnsafeUnpin for Region
impl UnwindSafe for Region
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