Trait WriteHandler

Source
pub trait WriteHandler<E>
where Self: Actor, Self::Context: ActorContext,
{ // Provided methods fn error(&mut self, err: E, ctx: &mut Self::Context) -> Running { ... } fn finished(&mut self, ctx: &mut Self::Context) { ... } }
Expand description

A helper trait for write handling.

WriteHandler is a helper for AsyncWrite types. Implementation of this trait is required for Writer and FramedWrite support.

Provided Methods§

Source

fn error(&mut self, err: E, ctx: &mut Self::Context) -> Running

Called when the writer emits error.

If this method returns ErrorAction::Continue writer processing continues otherwise stream processing stops.

Source

fn finished(&mut self, ctx: &mut Self::Context)

Called when the writer finishes.

By default this method stops actor’s Context.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§