pub trait StreamHandler<M: Send>: Service {
// Required method
fn handle(&mut self, msg: M, ctx: &mut ServiceContext<Self>);
}
Expand description
Handler for accepting streams of messages for a service
from streams attached to the service see attach_stream
on ServiceContext
Required Methods§
Sourcefn handle(&mut self, msg: M, ctx: &mut ServiceContext<Self>)
fn handle(&mut self, msg: M, ctx: &mut ServiceContext<Self>)
Handler for handling messages received from a stream
self
The service handling the message
msg
The message received
ctx
Mutable borrow of the service 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.