pub struct AsyncContext<A: 'static> { /* private fields */ }Implementations§
Source§impl<A: 'static> AsyncContext<A>
impl<A: 'static> AsyncContext<A>
Sourcepub fn cancellation(&self) -> Cancel
pub fn cancellation(&self) -> Cancel
The actor’s cancellation token, to hand to something that takes one.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Whether the actor is gone. Worth asking between steps of long work: what comes after is for nobody.
Sourcepub async fn cancelled(&self)
pub async fn cancelled(&self)
Waits until the actor is gone - one arm of a select!, for work that
has to end itself rather than be dropped at an await.
Sourcepub async fn until_gone<F: Future>(&self, fut: F) -> Option<F::Output>
pub async fn until_gone<F: Future>(&self, fut: F) -> Option<F::Output>
fut’s output, or None if the actor went away first.
Sourcepub fn publish<M>(&self, msg: M)
pub fn publish<M>(&self, msg: M)
Publishes msg on the global bus, from whichever thread this runs on:
the bus lives on the UI thread, and the event goes there with its
cause.
pub fn publish_local<M>(&self, bus: &EventBus, msg: M)
pub fn send<M>(&self, msg: M)
Trait Implementations§
Source§impl<A: 'static> Clone for AsyncContext<A>
impl<A: 'static> Clone for AsyncContext<A>
impl<A: 'static> Send for AsyncContext<A>
impl<A: 'static> Sync for AsyncContext<A>
Auto Trait Implementations§
impl<A> Freeze for AsyncContext<A>where
PhantomData<A>: Freeze,
impl<A> RefUnwindSafe for AsyncContext<A>where
PhantomData<A>: RefUnwindSafe,
impl<A> Unpin for AsyncContext<A>where
PhantomData<A>: Unpin,
impl<A> UnsafeUnpin for AsyncContext<A>where
PhantomData<A>: UnsafeUnpin,
impl<A> UnwindSafe for AsyncContext<A>where
PhantomData<A>: UnwindSafe,
Blanket Implementations§
impl<M> AllowedSignal<M> for Mwhere
M: 'static,
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