Skip to main content

FetchParams

Struct FetchParams 

Source
pub struct FetchParams {
    pub google_search: Option<bool>,
    pub timeout_ms: Option<f64>,
    pub wait_ms: Option<u64>,
    pub extra_headers: Option<HashMap<String, String>>,
    pub disable_resources: Option<bool>,
    pub network_idle: Option<bool>,
    pub load_dom: Option<bool>,
    pub wait_selector: Option<String>,
    pub wait_selector_state: Option<WaitState>,
    pub blocked_domains: Option<HashSet<String>>,
    pub solve_cloudflare: Option<bool>,
    pub selector_config: Option<HashMap<String, Value>>,
}
Expand description

Per-fetch parameter overrides – a subset of BrowserConfig that can be changed on a per-request basis.

Every field is Option – when None, the value falls back to the session’s BrowserConfig. Pass a FetchParams to [DynamicSession::fetch] or [StealthySession::fetch] to override specific settings for a single navigation without modifying the session-wide configuration.

Fields§

§google_search: Option<bool>

Override the Google-search warm-up flag for this request.

§timeout_ms: Option<f64>

Override the navigation timeout in milliseconds.

§wait_ms: Option<u64>

Override the post-load sleep delay in milliseconds.

§extra_headers: Option<HashMap<String, String>>

Override the extra HTTP headers for this request.

§disable_resources: Option<bool>

Override the resource-blocking flag for this request.

§network_idle: Option<bool>

Override the network-idle wait flag for this request.

§load_dom: Option<bool>

Override the DOM-content-loaded wait flag for this request.

§wait_selector: Option<String>

CSS selector to wait for before returning, overriding the config default.

§wait_selector_state: Option<WaitState>

Required state of the wait selector, overriding the config default.

§blocked_domains: Option<HashSet<String>>

Override the set of blocked domains for this request.

§solve_cloudflare: Option<bool>

Enable Cloudflare challenge solving for this request.

§selector_config: Option<HashMap<String, Value>>

Override selector-engine configuration for this request.

Implementations§

Source§

impl FetchParams

Source

pub fn merge_with_config(&self, config: &BrowserConfig) -> ResolvedFetchParams

Merge these optional overrides with the base BrowserConfig to produce resolved values.

For each field, if the FetchParams value is Some, it wins; otherwise the corresponding BrowserConfig value is used. The result is a ResolvedFetchParams with no Option fields, ready for immediate use during navigation.

Trait Implementations§

Source§

impl Clone for FetchParams

Source§

fn clone(&self) -> FetchParams

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FetchParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FetchParams

Source§

fn default() -> FetchParams

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more