pub struct ResponseScheduler { /* private fields */ }Expand description
Schedule manager for time-based response scheduling
Implementations§
Source§impl ResponseScheduler
impl ResponseScheduler
Sourcepub fn new(clock: Arc<VirtualClock>) -> Self
pub fn new(clock: Arc<VirtualClock>) -> Self
Create a new response scheduler
Sourcepub fn schedule(&self, response: ScheduledResponse) -> Result<String, String>
pub fn schedule(&self, response: ScheduledResponse) -> Result<String, String>
Schedule a response to be returned at a specific time
Sourcepub fn get_due_responses(&self) -> Vec<ScheduledResponse>
pub fn get_due_responses(&self) -> Vec<ScheduledResponse>
Get responses that should be triggered at the current time
Sourcepub fn list_scheduled(&self) -> Vec<ScheduledResponse>
pub fn list_scheduled(&self) -> Vec<ScheduledResponse>
Get all scheduled responses
Trait Implementations§
Source§impl Clone for ResponseScheduler
impl Clone for ResponseScheduler
Source§fn clone(&self) -> ResponseScheduler
fn clone(&self) -> ResponseScheduler
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ResponseScheduler
impl RefUnwindSafe for ResponseScheduler
impl Send for ResponseScheduler
impl Sync for ResponseScheduler
impl Unpin for ResponseScheduler
impl UnwindSafe for ResponseScheduler
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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