Skip to main content

Plan

Struct Plan 

Source
pub struct Plan {
Show 16 fields pub mode: Mode, pub js: bool, pub cap: f64, pub gov: bool, pub doc: Option<&'static str>, pub hint: bool, pub keys: Vec<Tier>, pub timeout: Option<Duration>, pub hedge: Duration, pub search: bool, pub prefetch: bool, pub avoid: Option<Tier>, pub wait: Option<Duration>, pub patience: Duration, pub prior: Option<PathBuf>, pub pool: Option<(PathBuf, usize)>,
}

Fields§

§mode: Mode§js: bool

js:true: skip plain (and Oxylabs without JS, where it runs); Bright Data, then Oxylabs rendering JavaScript.

§cap: f64§gov: bool§doc: Option<&'static str>

The URL names a document by its suffix: pdf, zip, a text document (Sites::doc_ext).

§hint: bool

The path may name a file (Sites::pdf_path, no .htm(l) suffix): Oxylabs gets PDF_OXY and Bright Data sends raw bytes, but a page that passes the content check is served as a page; only an answer that says PDF makes it a PDF run.

§keys: Vec<Tier>

Tiers with a key configured.

§timeout: Option<Duration>

timeout: for the JavaScript tiers (bd, oxyjs); plain and oxy without JS keep their own.

§hedge: Duration§search: bool

A web search, not a page: no gate tiers (an answer has no content check), search prices and timeout.

§prefetch: bool

A search’s prefetch (fetch:N): speculative work is free, so plain only, whatever provider: the search named; a page that needs a paid tier is fetched when opened (fats u<N> runs the whole ladder).

§avoid: Option<Tier>

The render that sent the page’s stored copy: js:true never asks it again (rendered).

§wait: Option<Duration>

A search’s wait: (every command answers by it): no tier starts after it, a call still running is cut (provider::late). None = a detached fetch, which runs to its end.

§patience: Duration

The command’s wait: (cli::wait_of), a page’s too: a rate limit’s pause ends inside it or is no retry (pause).

§prior: Option<PathBuf>

The folder of the copy stored before, the Markdown guard’s yardstick (md_weak); None = none.

§pool: Option<(PathBuf, usize)>

A batch’s cost: pool (pooled) and this run’s id in it; None = the run has cap to itself.

Implementations§

Source§

impl Plan

Source

pub fn new( url: &str, mode: Mode, js: bool, cap: f64, timeout: Option<Duration>, ) -> Plan

Source

pub fn search(mode: Mode, cap: f64, timeout: Option<Duration>) -> Plan

A web search: the search rows (Oxylabs, then Bright Data beside it after the hedge); provider: = that one only.

Source

pub fn of(cmd: &Cmd, url: Option<&str>) -> Plan

THE plan of a command’s mods (provider:, js:, cost:, timeout:, hedge:), a page’s for url, else a search’s: what a fetch runs, dry:true routes and an arrow quotes (worst).

Source

pub fn pdf_run(&self, done: &[Hop]) -> bool

THE document rule: this run fetches a PDF when its URL names one (.pdf) or an answer said so (magic, or the content type on a failure). A PDF is never rendered: no oxyjs, and js:true does not skip plain.

Source

pub fn ladder(&self, done: &[Hop]) -> Vec<Tier>

THE ladder rule: the tiers in the order they may run, given the finished hops (pdf_run; none = before any answer). auto = the capability rows (provider::Spec::can) that do this job, cheapest first (table order on a tie: bd before oxyjs); a paid no-JS tier leaves a page’s ladder when another provider’s render has a key (it served 3 of 20 pages plain failed on), so with one provider’s key every rung of that provider runs, unless plain’s wall needs a render (Check::render_first: after a JS challenge or shell oxy no-JS served 0/33, after a 403 or captcha 11/26). With both keys it stays, before the renders, after plain’s captcha only (Check::no_js_first: Reddit 25/34 in ~4.4 s for $0.0010, a render $0.0015), or first when plain is off (no free verdict to wait for: a page both renders cut at 60 s served without JS in 6.4 s); one try, no site log. Never after a shell, the page needs JS (0/3 served, each +$0.0010, +4–10 s), nor after a paid no-JS tier OUR cut stopped: the next is the same slow page without JS (oxy 10 s, then decodo 15 s). provider:oxy = every tier of that key, without JS first (oxy, oxyjs).

Source

pub fn hedged(&self) -> bool

The router picks and races the tiers (auto), or the one tier asked for is free (provider:plain: no hedge:off to print); false = the agent asked for a paid tier (js:true, provider:bd): hedge:off.

Source

pub fn search_wait(&self, wait: Duration) -> Duration

THE search patience: wait:, or longer, the leading keyed search provider’s own answer time (Spec::search_s: bd answers in 4.5-25 s, bd-only got 0/3 searches at 5 s). Longer than wait: = the search runs detached (cli::searching): the caller still answers at wait:.

Trait Implementations§

Source§

impl Clone for Plan

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Default for Plan

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Forget for Plan

§

impl Freeze for Plan

§

impl RefUnwindSafe for Plan

§

impl Send for Plan

§

impl Sync for Plan

§

impl Unpin for Plan

§

impl UnsafeUnpin for Plan

§

impl UnwindSafe for Plan

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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<U, T> ToOwnedObj<U> for T
where U: FromObjRef<T>,

Source§

fn to_owned_obj(&self, data: FontData<'_>) -> U

Convert this type into T, using the provided data to resolve any offsets.
Source§

impl<U, T> ToOwnedTable<U> for T
where U: FromTableRef<T>,

Source§

fn to_owned_table(&self) -> U

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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<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