Trait actix::FramedActor
[−]
[src]
pub trait FramedActor: Actor { type Io: AsyncRead + AsyncWrite; type Codec: Encoder + Decoder; fn error(
&mut self,
err: <Self::Codec as Encoder>::Error,
ctx: &mut Self::Context
) { ... } fn framed<Addr>(self, io: Self::Io, codec: Self::Codec) -> Addr
where
Self: Actor<Context = FramedContext<Self>> + ActorAddress<Self, Addr>,
Self: StreamHandler<<Self::Codec as Decoder>::Item, <Self::Codec as Decoder>::Error>,
<Self::Codec as Decoder>::Item: ResponseType, { ... } fn create_framed<Addr, F>(io: Self::Io, codec: Self::Codec, f: F) -> Addr
where
Self: Actor<Context = FramedContext<Self>> + ActorAddress<Self, Addr>,
Self: StreamHandler<<Self::Codec as Decoder>::Item, <Self::Codec as Decoder>::Error>,
<Self::Codec as Decoder>::Item: ResponseType,
F: FnOnce(&mut FramedContext<Self>) -> Self + 'static, { ... } }
Actor trait that allows to handle tokio_io::codec::Framed
objects.
Associated Types
Provided Methods
fn error(
&mut self,
err: <Self::Codec as Encoder>::Error,
ctx: &mut Self::Context
)
&mut self,
err: <Self::Codec as Encoder>::Error,
ctx: &mut Self::Context
)
Method is called on sink error. By default it does nothing.
fn framed<Addr>(self, io: Self::Io, codec: Self::Codec) -> Addr where
Self: Actor<Context = FramedContext<Self>> + ActorAddress<Self, Addr>,
Self: StreamHandler<<Self::Codec as Decoder>::Item, <Self::Codec as Decoder>::Error>,
<Self::Codec as Decoder>::Item: ResponseType,
Self: Actor<Context = FramedContext<Self>> + ActorAddress<Self, Addr>,
Self: StreamHandler<<Self::Codec as Decoder>::Item, <Self::Codec as Decoder>::Error>,
<Self::Codec as Decoder>::Item: ResponseType,
Start new actor, returns address of this actor.
fn create_framed<Addr, F>(io: Self::Io, codec: Self::Codec, f: F) -> Addr where
Self: Actor<Context = FramedContext<Self>> + ActorAddress<Self, Addr>,
Self: StreamHandler<<Self::Codec as Decoder>::Item, <Self::Codec as Decoder>::Error>,
<Self::Codec as Decoder>::Item: ResponseType,
F: FnOnce(&mut FramedContext<Self>) -> Self + 'static,
Self: Actor<Context = FramedContext<Self>> + ActorAddress<Self, Addr>,
Self: StreamHandler<<Self::Codec as Decoder>::Item, <Self::Codec as Decoder>::Error>,
<Self::Codec as Decoder>::Item: ResponseType,
F: FnOnce(&mut FramedContext<Self>) -> Self + 'static,
This function starts new actor, returns address of this actor. Actor is created by factory function.