[][src]Trait actix::Handler

pub trait Handler<M> where
    Self: Actor,
    M: Message
{ type Result: MessageResponse<Self, M>; fn handle(&mut self, msg: M, ctx: &mut Self::Context) -> Self::Result; }

Describes how to handle messages of a specific type.

Implementing Handler is a general way to handle incoming messages, streams, and futures.

The type M is a message which can be handled by the actor.

Associated Types

type Result: MessageResponse<Self, M>

The type of value that this handler will return.

Loading content...

Required methods

fn handle(&mut self, msg: M, ctx: &mut Self::Context) -> Self::Result

This method is called for every message received by this actor.

Loading content...

Implementors

impl Handler<Connect> for Resolver[src]

type Result = ResponseActFuture<Self, Result<TcpStream, ResolverError>>

impl Handler<ConnectAddr> for Resolver[src]

type Result = ResponseActFuture<Self, Result<TcpStream, ResolverError>>

impl Handler<Resolve> for Resolver[src]

type Result = ResponseActFuture<Self, Result<VecDeque<SocketAddr>, ResolverError>>

impl<M: 'static, T: Sized + Unpin + 'static> Handler<M> for Mocker<T> where
    M: Message,
    <M as Message>::Result: MessageResponse<Mocker<T>, M>, 
[src]

type Result = M::Result

Loading content...