pub struct ExtractionRequest {
pub template: ExtractionTemplate,
pub url: String,
pub html: String,
pub idempotency_key: IdempotencyKey,
pub timeout_ms: u64,
pub context: Option<Value>,
}Expand description
Request to extract data from a page using a template
Fields§
§template: ExtractionTemplateTemplate to use for extraction
url: StringTarget URL (for context/logging)
html: StringHTML content of the page to extract from
idempotency_key: IdempotencyKeyIdempotency key for safe retries
timeout_ms: u64Timeout in milliseconds
context: Option<Value>Optional extraction context (arbitrary JSON)
Implementations§
Source§impl ExtractionRequest
impl ExtractionRequest
Sourcepub fn new(
template: ExtractionTemplate,
url: impl Into<String>,
html: impl Into<String>,
) -> Self
pub fn new( template: ExtractionTemplate, url: impl Into<String>, html: impl Into<String>, ) -> Self
Create a new extraction request
Sourcepub const fn with_idempotency_key(self, key: IdempotencyKey) -> Self
pub const fn with_idempotency_key(self, key: IdempotencyKey) -> Self
Set idempotency key
Sourcepub const fn with_timeout(self, ms: u64) -> Self
pub const fn with_timeout(self, ms: u64) -> Self
Set timeout
Sourcepub fn with_context(self, context: Value) -> Self
pub fn with_context(self, context: Value) -> Self
Set context
Trait Implementations§
Source§impl Clone for ExtractionRequest
impl Clone for ExtractionRequest
Source§fn clone(&self) -> ExtractionRequest
fn clone(&self) -> ExtractionRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ExtractionRequest
impl Debug for ExtractionRequest
Source§impl<'de> Deserialize<'de> for ExtractionRequest
impl<'de> Deserialize<'de> for ExtractionRequest
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 ExtractionRequest
impl RefUnwindSafe for ExtractionRequest
impl Send for ExtractionRequest
impl Sync for ExtractionRequest
impl Unpin for ExtractionRequest
impl UnsafeUnpin for ExtractionRequest
impl UnwindSafe for ExtractionRequest
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