pub struct Schedule<In, Out> { /* private fields */ }Expand description
A Schedule determines whether to continue and how long to wait. It maintains internal state. For simplicity in this MVP, we use a trait object or a struct with a closure that returns state. Refined: Schedule<In, Out> We need to run it. Schedule with generic composition support
Implementations§
Source§impl<In, Out> Schedule<In, Out>
impl<In, Out> Schedule<In, Out>
pub fn recurs(n: usize) -> Schedule<In, usize>
pub fn spaced(duration: Duration) -> Schedule<In, ()>
pub fn exponential(base: Duration, factor: f64) -> Schedule<In, Duration>
pub fn jittered(self, min: f64, max: f64) -> Schedule<In, Out>
pub fn intersect<Out2>( self, other: Schedule<In, Out2>, ) -> Schedule<In, (Out, Out2)>
pub fn union<Out2>( self, other: Schedule<In, Out2>, ) -> Schedule<In, (Option<Out>, Option<Out2>)>
pub fn driver(&self) -> Box<dyn ScheduleDriver<In, Out> + Send + Sync>
Trait Implementations§
Auto Trait Implementations§
impl<In, Out> Freeze for Schedule<In, Out>
impl<In, Out> !RefUnwindSafe for Schedule<In, Out>
impl<In, Out> Send for Schedule<In, Out>
impl<In, Out> Sync for Schedule<In, Out>
impl<In, Out> Unpin for Schedule<In, Out>
impl<In, Out> !UnwindSafe for Schedule<In, Out>
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