pub struct SimulatedScheduler { /* private fields */ }Expand description
Simulated scheduler that generates timer events deterministically.
Instead of waiting for real time to pass, advance() jumps the clock
forward and collects all timer events that would have fired in that window.
Implementations§
Source§impl SimulatedScheduler
impl SimulatedScheduler
Sourcepub const fn new(start_time: DateTime<Utc>) -> Self
pub const fn new(start_time: DateTime<Utc>) -> Self
Create a new scheduler starting at the given time.
Sourcepub fn register_timers(&mut self, configs: Vec<(u64, Option<u64>, String)>)
pub fn register_timers(&mut self, configs: Vec<(u64, Option<u64>, String)>)
Register timers from engine configuration.
Each tuple is (interval_ns, initial_delay_ns, event_type).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SimulatedScheduler
impl RefUnwindSafe for SimulatedScheduler
impl Send for SimulatedScheduler
impl Sync for SimulatedScheduler
impl Unpin for SimulatedScheduler
impl UnsafeUnpin for SimulatedScheduler
impl UnwindSafe for SimulatedScheduler
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more