Skip to main content

spider_route/
lib.rs

1//! Picks the cheapest Spider Cloud request settings that are likely to work.
2//!
3//! This crate makes one decision and makes it locally: given the shape of a
4//! request, which settings should the first attempt use. It does no network
5//! work, runs no async runtime, and holds no API client, so depending on it
6//! costs a consumer nothing but the vocabulary.
7//!
8//! A model is optional. With no weights compiled in, [`HeuristicRouter`]
9//! answers from rules alone, and that path is tested on its own so it cannot
10//! rot.
11
12#![cfg_attr(docsrs, feature(doc_cfg))]
13#![forbid(unsafe_code)]
14#![warn(missing_docs)]
15
16pub mod action;
17pub mod decision;
18pub mod domain;
19pub mod features;
20pub mod heuristic;
21pub mod router;
22
23pub use action::{Country, InvalidCountry, ProxyPool, RequestMode, PROXY_POOLS};
24pub use decision::{Action, RouteDecision, RouteSource, Wait};
25pub use domain::{host_shape, registrable_domain, HostShape, IpKind, TldSlot};
26pub use features::{
27    featurize, CallerPins, DeclaredNeed, ExtClass, FeatureVector, KeyClass, RouteInput,
28    SegmentClass, SiteMemory, StatusClass, FEATURES_USED, FEATURE_DIM,
29};
30pub use heuristic::{HeuristicRouter, Rule};
31pub use router::{AttemptOutcome, Router, RouterVersion};