pub struct CompositeStrategy { /* private fields */ }Expand description
A composite probe scheduler that runs multiple strategies in parallel and deduplicates their output.
Implementations§
Source§impl CompositeStrategy
impl CompositeStrategy
Sourcepub fn new() -> Self
pub fn new() -> Self
Create an empty composite. At least one strategy must be added before
the first tick, or on_tick will return an empty list.
Sourcepub fn with(self, strategy: Box<dyn NeighborProbeStrategy>) -> Self
pub fn with(self, strategy: Box<dyn NeighborProbeStrategy>) -> Self
Add a strategy to the composite (builder).
Sourcepub fn push(&mut self, strategy: Box<dyn NeighborProbeStrategy>)
pub fn push(&mut self, strategy: Box<dyn NeighborProbeStrategy>)
Add a strategy by reference (builder variant for use without consuming).
Trait Implementations§
Source§impl Default for CompositeStrategy
impl Default for CompositeStrategy
Source§impl NeighborProbeStrategy for CompositeStrategy
impl NeighborProbeStrategy for CompositeStrategy
Source§fn on_tick(&mut self, now: Instant) -> Vec<ProbeRequest>
fn on_tick(&mut self, now: Instant) -> Vec<ProbeRequest>
Advance the scheduler’s clock to
now. Read moreSource§fn on_probe_success(&mut self, rtt: Duration)
fn on_probe_success(&mut self, rtt: Duration)
A probe response was received with the given round-trip time. Read more
Source§fn on_probe_timeout(&mut self)
fn on_probe_timeout(&mut self)
A probe timed out (no response within
probe_timeout). Read moreSource§fn trigger(&mut self, event: TriggerEvent)
fn trigger(&mut self, event: TriggerEvent)
An external topology event occurred. Read more
Auto Trait Implementations§
impl Freeze for CompositeStrategy
impl !RefUnwindSafe for CompositeStrategy
impl Send for CompositeStrategy
impl !Sync for CompositeStrategy
impl Unpin for CompositeStrategy
impl !UnwindSafe for CompositeStrategy
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