Struct single_executor::SleepFutureRunner [−][src]
pub struct SleepFutureRunner<Q, CS> where
CS: TryThreadSpawner<()>, { /* fields omitted */ }
Expand description
Runs asynchronous sleep functions by launching a separate handler thread. Each new instance of this spawns a thread.
Implementations
impl<Q, CS> SleepFutureRunner<Q, CS> where
Q: 'static + TimeoutQueue<Item = SleepMessage<CS>> + Send + Sync,
CS: TryThreadSpawner<()> + TimeFunctions,
[src]
impl<Q, CS> SleepFutureRunner<Q, CS> where
Q: 'static + TimeoutQueue<Item = SleepMessage<CS>> + Send + Sync,
CS: TryThreadSpawner<()> + TimeFunctions,
[src]Tries to create a new SleepFutureRunner
by launching a thread.
Create a new SleepFutureRunner
by launching a thread. Requires thread spawning to be infallible.
Creates a future that sleeps for a given duration from this call.
Creates a future that sleeps until a given CS::InstantType
.
Runs a given future with a timeout.
pub fn timeout_for_should_stop<'a, T, F>(
&'a self,
future: impl FnOnce(ShouldFinish) -> F + 'a,
time: Duration
) -> impl Future<Output = Result<T, ()>> + 'a where
T: 'a,
F: Future<Output = T> + 'a,
[src]
pub fn timeout_for_should_stop<'a, T, F>(
&'a self,
future: impl FnOnce(ShouldFinish) -> F + 'a,
time: Duration
) -> impl Future<Output = Result<T, ()>> + 'a where
T: 'a,
F: Future<Output = T> + 'a,
[src]Runs a given future with a timeout. Allows for a should stop parameter.
pub async fn timeout_until<T>(
&self,
future: impl Future<Output = T>,
instant: CS::InstantType
) -> Result<T, ()>
[src]
pub async fn timeout_until<T>(
&self,
future: impl Future<Output = T>,
instant: CS::InstantType
) -> Result<T, ()>
[src]Runs a given future with a timeout.
pub async fn timeout_until_should_stop<T, F>(
&self,
future: impl FnOnce(ShouldFinish) -> F,
instant: CS::InstantType
) -> Result<T, ()> where
F: Future<Output = T>,
[src]
pub async fn timeout_until_should_stop<T, F>(
&self,
future: impl FnOnce(ShouldFinish) -> F,
instant: CS::InstantType
) -> Result<T, ()> where
F: Future<Output = T>,
[src]Runs a given future with a timeout. Allows for a should stop parameter.
Trait Implementations
Auto Trait Implementations
impl<Q, CS> RefUnwindSafe for SleepFutureRunner<Q, CS> where
Q: RefUnwindSafe,
impl<Q, CS> Send for SleepFutureRunner<Q, CS> where
Q: Send + Sync,
impl<Q, CS> Sync for SleepFutureRunner<Q, CS> where
Q: Send + Sync,
impl<Q, CS> Unpin for SleepFutureRunner<Q, CS>
impl<Q, CS> UnwindSafe for SleepFutureRunner<Q, CS> where
Q: RefUnwindSafe,