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<'a, Q, CS> SleepFutureRunner<Q, CS> where
Q: 'static + TimeoutQueue<Item = SleepMessage<CS>> + Send + Sync,
CS: TryThreadSpawner<()> + TimeFunctions,
[src]
impl<'a, Q, CS> SleepFutureRunner<Q, CS> where
Q: 'static + TimeoutQueue<Item = SleepMessage<CS>> + Send + Sync,
CS: TryThreadSpawner<()> + TimeFunctions,
[src]pub fn try_new(queue: Q) -> Result<Self, CS::SpawnError>
[src]
pub fn try_new(queue: Q) -> Result<Self, CS::SpawnError>
[src]Tries to create a new SleepFutureRunner
by launching a thread.
pub fn new(queue: Q) -> Self where
CS: ThreadSpawner<()>,
[src]
pub fn new(queue: Q) -> Self where
CS: ThreadSpawner<()>,
[src]Create a new SleepFutureRunner
by launching a thread. Requires thread spawning to be infallible.
pub fn sleep_for(&self, time: Duration) -> SleepFutureⓘNotable traits for SleepFuture
impl Future for SleepFuture type Output = ();
[src]
pub fn sleep_for(&self, time: Duration) -> SleepFutureⓘNotable traits for SleepFuture
impl Future for SleepFuture type Output = ();
[src]Creates a future that sleeps for a given duration from this call.
pub fn sleep_until(&self, instant: CS::InstantType) -> SleepFutureⓘNotable traits for SleepFuture
impl Future for SleepFuture type Output = ();
[src]
pub fn sleep_until(&self, instant: CS::InstantType) -> SleepFutureⓘNotable traits for SleepFuture
impl Future for SleepFuture type Output = ();
[src]Creates a future that sleeps until a given CS::InstantType
.
pub fn thread_handle(&self) -> &CS::ThreadHandle
[src]
pub fn thread_handle(&self) -> &CS::ThreadHandle
[src]Gets a shared reference to the CS::ThreadHandle
that is running the sleep operations.
pub fn into_thread_handle(self) -> CS::ThreadHandle
[src]
pub fn into_thread_handle(self) -> CS::ThreadHandle
[src]Converts this runner into a . If this is the last runner for this thread then the thread will stop soon.
Trait Implementations
impl<Q: Debug, CS: Debug> Debug for SleepFutureRunner<Q, CS> where
CS: TryThreadSpawner<()>,
CS::ThreadHandle: Debug,
[src]
impl<Q: Debug, CS: Debug> Debug for SleepFutureRunner<Q, CS> where
CS: TryThreadSpawner<()>,
CS::ThreadHandle: Debug,
[src]Auto Trait Implementations
impl<Q, CS> RefUnwindSafe for SleepFutureRunner<Q, CS> where
Q: RefUnwindSafe,
<CS as TryThreadSpawner<()>>::ThreadHandle: RefUnwindSafe,
Q: RefUnwindSafe,
<CS as TryThreadSpawner<()>>::ThreadHandle: RefUnwindSafe,
impl<Q, CS> Send for SleepFutureRunner<Q, CS> where
Q: Send + Sync,
<CS as TryThreadSpawner<()>>::ThreadHandle: Send,
Q: Send + Sync,
<CS as TryThreadSpawner<()>>::ThreadHandle: Send,
impl<Q, CS> Sync for SleepFutureRunner<Q, CS> where
Q: Send + Sync,
<CS as TryThreadSpawner<()>>::ThreadHandle: Sync,
Q: Send + Sync,
<CS as TryThreadSpawner<()>>::ThreadHandle: Sync,
impl<Q, CS> Unpin for SleepFutureRunner<Q, CS> where
<CS as TryThreadSpawner<()>>::ThreadHandle: Unpin,
<CS as TryThreadSpawner<()>>::ThreadHandle: Unpin,
impl<Q, CS> UnwindSafe for SleepFutureRunner<Q, CS> where
Q: RefUnwindSafe,
<CS as TryThreadSpawner<()>>::ThreadHandle: UnwindSafe,
Q: RefUnwindSafe,
<CS as TryThreadSpawner<()>>::ThreadHandle: UnwindSafe,