pub trait Service<In> {
type Out;
// Required method
fn handle(
&mut self,
input: In,
cx: &Context,
) -> impl Stream<Item = Self::Out> + Send;
// Provided methods
fn handle_stream(
&mut self,
input: impl Stream<Item = In> + Send,
cx: &Context,
) -> impl Stream<Item = Self::Out> + Send
where In: Send,
Self: Send,
Self::Out: Send { ... }
fn finalize(&mut self, _cx: &Context) -> impl Future<Output = ()>
where Self: Sized { ... }
}Required Associated Types§
Required Methods§
Provided Methods§
fn handle_stream( &mut self, input: impl Stream<Item = In> + Send, cx: &Context, ) -> impl Stream<Item = Self::Out> + Send
fn finalize(&mut self, _cx: &Context) -> impl Future<Output = ()>where
Self: Sized,
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.