pub struct ExtractionSchema {
pub name: String,
pub description: Option<String>,
pub schema: String,
pub strict: bool,
}Expand description
Schema for structured data extraction.
Define what data to extract from pages with JSON Schema.
Fields§
§name: StringName for the schema (e.g., “product_listing”).
description: Option<String>Optional description of what to extract.
schema: StringJSON Schema definition as a string.
strict: boolWhether to enforce strict schema adherence.
Implementations§
Source§impl ExtractionSchema
impl ExtractionSchema
Sourcepub fn new(
name: impl Into<String>,
schema: impl Into<String>,
) -> ExtractionSchema
pub fn new( name: impl Into<String>, schema: impl Into<String>, ) -> ExtractionSchema
Create a new extraction schema.
Sourcepub fn with_description(
name: impl Into<String>,
description: impl Into<String>,
schema: impl Into<String>,
) -> ExtractionSchema
pub fn with_description( name: impl Into<String>, description: impl Into<String>, schema: impl Into<String>, ) -> ExtractionSchema
Create with description.
Sourcepub fn strict(self) -> ExtractionSchema
pub fn strict(self) -> ExtractionSchema
Set strict mode.
Trait Implementations§
Source§impl Clone for ExtractionSchema
impl Clone for ExtractionSchema
Source§fn clone(&self) -> ExtractionSchema
fn clone(&self) -> ExtractionSchema
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 ExtractionSchema
impl Debug for ExtractionSchema
Source§impl Default for ExtractionSchema
impl Default for ExtractionSchema
Source§fn default() -> ExtractionSchema
fn default() -> ExtractionSchema
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ExtractionSchema
impl<'de> Deserialize<'de> for ExtractionSchema
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ExtractionSchema, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ExtractionSchema, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ExtractionSchema
impl PartialEq for ExtractionSchema
Source§impl Serialize for ExtractionSchema
impl Serialize for ExtractionSchema
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for ExtractionSchema
Auto Trait Implementations§
impl Freeze for ExtractionSchema
impl RefUnwindSafe for ExtractionSchema
impl Send for ExtractionSchema
impl Sync for ExtractionSchema
impl Unpin for ExtractionSchema
impl UnsafeUnpin for ExtractionSchema
impl UnwindSafe for ExtractionSchema
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