Struct crossbus::context::ContextRunner
source · pub struct ContextRunner<A>where
A: Actor,{ /* private fields */ }Expand description
Future-oriented runner that drive all tasks into completion
Implementations§
source§impl<A: Actor> ContextRunner<A>
impl<A: Actor> ContextRunner<A>
sourcepub fn new(ctx: Context<A>, act: ActorGuard<A>) -> Self
pub fn new(ctx: Context<A>, act: ActorGuard<A>) -> Self
create an instance
sourcepub fn is_blocked(&self) -> bool
pub fn is_blocked(&self) -> bool
if the actor is blocked or not
Trait Implementations§
source§impl<A: Actor> Debug for ContextRunner<A>
impl<A: Actor> Debug for ContextRunner<A>
source§impl<A> Future for ContextRunner<A>where
A: Actor,
impl<A> Future for ContextRunner<A>where A: Actor,
Safety: no technical guarantee that only
one mutable access when mutably borrow
ActorGuard<A> in ContextRunner.
but so far it is safe to use.
Since mutation only happens in poll and its
called-functions inside, and at most one mutable
access happens there.
impl<A: Actor> Send for ContextRunner<A>
impl<A: Actor> Sync for ContextRunner<A>
Auto Trait Implementations§
impl<A> !RefUnwindSafe for ContextRunner<A>
impl<A> Unpin for ContextRunner<A>
impl<A> !UnwindSafe for ContextRunner<A>
Blanket Implementations§
§impl<T> FutureExt for Twhere
T: Future + ?Sized,
impl<T> FutureExt for Twhere T: Future + ?Sized,
§fn delay(self, dur: Duration) -> DelayFuture<Self>where
Self: Sized,
fn delay(self, dur: Duration) -> DelayFuture<Self>where Self: Sized,
Returns a Future that delays execution for a specified time. Read more
§fn flatten(self) -> FlattenFuture<Self, <Self::Output as IntoFuture>::Future>where
Self: Sized,
Self::Output: IntoFuture,
fn flatten(self) -> FlattenFuture<Self, <Self::Output as IntoFuture>::Future>where Self: Sized, Self::Output: IntoFuture,
Flatten out the execution of this future when the result itself
can be converted into another future. Read more
§fn race<F>(self, other: F) -> Race<Self, F>where
Self: Future + Sized,
F: Future<Output = Self::Output>,
fn race<F>(self, other: F) -> Race<Self, F>where Self: Future + Sized, F: Future<Output = Self::Output>,
Waits for one of two similarly-typed futures to complete. Read more
§fn try_race<F, T, E>(self, other: F) -> TryRace<Self, F>where
Self: Future<Output = Result<T, E>> + Sized,
F: Future<Output = Self::Output>,
fn try_race<F, T, E>(self, other: F) -> TryRace<Self, F>where Self: Future<Output = Result<T, E>> + Sized, F: Future<Output = Self::Output>,
Waits for one of two similarly-typed fallible futures to complete. Read more
§fn join<F>(self, other: F) -> Join<Self, F>where
Self: Future + Sized,
F: Future,
fn join<F>(self, other: F) -> Join<Self, F>where Self: Future + Sized, F: Future,
Waits for two similarly-typed futures to complete. Read more
§impl<F> FutureExt for Fwhere
F: Future + ?Sized,
impl<F> FutureExt for Fwhere F: Future + ?Sized,
§fn catch_unwind(self) -> CatchUnwind<Self>where
Self: Sized + UnwindSafe,
fn catch_unwind(self) -> CatchUnwind<Self>where Self: Sized + UnwindSafe,
Catches panics while polling the future. Read more
source§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere F: Future,
§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more