pub struct WeightedStrategy { /* private fields */ }Expand description
Strategy: A/B testing – probabilistically route between two strategies.
Uses a weight (0.0-1.0) to determine how often strategy A vs B is chosen. A weight of 0.7 means 70% of requests go through strategy A.
Implementations§
Source§impl WeightedStrategy
impl WeightedStrategy
Sourcepub fn new(
strategy_a: Box<dyn RoutingStrategy>,
strategy_b: Box<dyn RoutingStrategy>,
weight_a: f64,
) -> Self
pub fn new( strategy_a: Box<dyn RoutingStrategy>, strategy_b: Box<dyn RoutingStrategy>, weight_a: f64, ) -> Self
Create a new weighted strategy for A/B testing.
weight_a is the fraction of requests routed to strategy A (0.0 to 1.0).
Trait Implementations§
Source§impl Debug for WeightedStrategy
impl Debug for WeightedStrategy
Source§impl RoutingStrategy for WeightedStrategy
impl RoutingStrategy for WeightedStrategy
Auto Trait Implementations§
impl !Freeze for WeightedStrategy
impl !RefUnwindSafe for WeightedStrategy
impl Send for WeightedStrategy
impl Sync for WeightedStrategy
impl Unpin for WeightedStrategy
impl UnsafeUnpin for WeightedStrategy
impl !UnwindSafe for WeightedStrategy
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