pub struct RoutingPolicy { /* private fields */ }Expand description
How RoutingClassifier decides. Defaults to RoutingMode::Off:
a cheaper adapter is earned by measurement, never assumed.
Implementations§
Source§impl RoutingPolicy
impl RoutingPolicy
Sourcepub fn pinned(adapter: AdapterId) -> Self
pub fn pinned(adapter: AdapterId) -> Self
Everything to adapter, which must be one the router holds.
Sourcepub fn measured(evidence: AgreementReport) -> Self
pub fn measured(evidence: AgreementReport) -> Self
Route per kind on evidence, which must compare the router’s two
adapters.
Sourcepub fn thresholds(self, adapter: AdapterId, thresholds: Thresholds) -> Self
pub fn thresholds(self, adapter: AdapterId, thresholds: Thresholds) -> Self
The thresholds for adapter. Without thresholds for the cheap
adapter nothing is routed to it.
Sourcepub const fn min_questions(self, n: usize) -> Self
pub const fn min_questions(self, n: usize) -> Self
How many measured questions a kind needs, at the thresholds, before the cheap adapter may answer it. Default 20.
Sourcepub const fn max_disagreement_rate(self, rate: f64) -> Self
pub const fn max_disagreement_rate(self, rate: f64) -> Self
The most disagreement a kind may show, at the thresholds, and still go to the cheap adapter; equal to the cap passes. Default 0.05.
Trait Implementations§
Source§impl Clone for RoutingPolicy
impl Clone for RoutingPolicy
Source§impl Debug for RoutingPolicy
impl Debug for RoutingPolicy
Source§impl Default for RoutingPolicy
impl Default for RoutingPolicy
Source§impl PartialEq for RoutingPolicy
impl PartialEq for RoutingPolicy
impl StructuralPartialEq for RoutingPolicy
Auto Trait Implementations§
impl Freeze for RoutingPolicy
impl RefUnwindSafe for RoutingPolicy
impl Send for RoutingPolicy
impl Sync for RoutingPolicy
impl Unpin for RoutingPolicy
impl UnsafeUnpin for RoutingPolicy
impl UnwindSafe for RoutingPolicy
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