Struct meio::Context[][src]

pub struct Context<A: Actor> { /* fields omitted */ }

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]

Starts and binds an Actor.

pub fn spawn_task<T, M>(
    &mut self,
    task: T,
    tag: M,
    group: A::GroupBy
) -> TaskAddress<T> where
    T: LiteTask,
    A: TaskEliminated<T, M>,
    M: Tag
[src]

Starts and binds a Task.

pub fn attach<S, M>(&mut self, stream: S, tag: M, group: A::GroupBy) where
    S: Stream + Unpin + Send + 'static,
    S::Item: Send,
    A: Consumer<S::Item>,
    M: Tag
[src]

Spawns interaction task that forwards the result of an interaction.

pub fn track_interaction<I, M>(
    &mut self,
    task: InteractionTask<I>,
    tag: M,
    group: A::GroupBy
) where
    I: Interaction,
    A: InteractionDone<I, M>,
    M: Tag
[src]

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]

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

impl<A> !UnwindSafe for Context<A>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.