Struct meio::Context [−][src]
Context
of a ActorRuntime
that contains Address
and Receiver
.
Implementations
impl<A: Actor> Context<A>
[src]
pub fn address(&mut self) -> &mut Address<A>
[src]
Returns an instance of the Address
.
pub fn spawn_actor<T>(&mut self, actor: T, group: A::GroupBy) -> Address<T> where
T: Actor + StartedBy<A> + InterruptedBy<A>,
A: Eliminated<T>,
[src]
T: Actor + StartedBy<A> + InterruptedBy<A>,
A: Eliminated<T>,
Starts and binds an Actor
.
pub fn spawn_task<T>(&mut self, task: T, group: A::GroupBy) -> TaskAddress<T> where
T: LiteTask,
A: TaskEliminated<T>,
[src]
T: LiteTask,
A: TaskEliminated<T>,
Starts and binds a Task
.
pub fn attach<S>(&mut self, stream: S, group: A::GroupBy) where
S: Stream + Unpin + Send + 'static,
S::Item: Send,
A: Consumer<S::Item>,
[src]
S: Stream + Unpin + Send + 'static,
S::Item: Send,
A: Consumer<S::Item>,
Spawns interaction task that forwards the result of an interaction.
pub fn track_interaction<I>(
&mut self,
task: InteractionTask<I>,
group: A::GroupBy
) where
I: Interaction,
A: InteractionDone<I>,
[src]
&mut self,
task: InteractionTask<I>,
group: A::GroupBy
) where
I: Interaction,
A: InteractionDone<I>,
Spawns InteractionTask
as a LiteTask
and await the result as an Action
that will call InteractionDone
handler.
pub fn interrupt<T>(&mut self, address: &mut Address<T>) -> Result<(), Error> where
T: Actor + InterruptedBy<A>,
[src]
T: Actor + InterruptedBy<A>,
Interrupts an Actor
.
pub fn is_terminating(&self) -> bool
[src]
Returns true if the shutdown process is in progress.
pub fn not_terminating(&self) -> Result<(), Error>
[src]
Returns Error
if the Actor
is terminating.
Useful for checking in handlers.
pub fn termination_sequence(&mut self, sequence: Vec<A::GroupBy>)
[src]
Increases the priority of the Actor
’s type.
pub fn stop(&mut self)
[src]
Stops the runtime of the Actor
on one message will be processed after this call.
It’s recommended way to terminate Actor
is the shutdown
method.
Attention! Termination process will never started here and all spawned actors and tasks will be orphaned.
pub fn shutdown(&mut self)
[src]
Starts graceful termination of the Actor
.
Auto Trait Implementations
impl<A> !RefUnwindSafe for Context<A>
impl<A> Send for Context<A>
impl<A> !Sync for Context<A>
impl<A> Unpin for Context<A> where
<A as Actor>::GroupBy: Unpin,
<A as Actor>::GroupBy: Unpin,
impl<A> !UnwindSafe for Context<A>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,