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: booljs: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: boolThe 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: boolA web search, not a page: no gate tiers (an answer has no content check), search prices and timeout.
prefetch: boolA 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: DurationThe 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
impl Plan
pub fn new( url: &str, mode: Mode, js: bool, cap: f64, timeout: Option<Duration>, ) -> Plan
Sourcepub fn search(mode: Mode, cap: f64, timeout: Option<Duration>) -> Plan
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.
Sourcepub fn of(cmd: &Cmd, url: Option<&str>) -> Plan
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).
Sourcepub fn pdf_run(&self, done: &[Hop]) -> bool
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.
Sourcepub fn ladder(&self, done: &[Hop]) -> Vec<Tier>
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).
Sourcepub fn hedged(&self) -> bool
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.
Sourcepub fn search_wait(&self, wait: Duration) -> Duration
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§
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> 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.