SimpleService

Trait SimpleService 

Source
pub trait SimpleService {
    type Interface: Interface;

    // Required method
    fn handle_message(
        &self,
        message: Self::Interface,
    ) -> impl Future<Output = ()> + Send;
}
Expand description

A service that handles messages one at a time.

When the message handler cannot keep up with incoming messages, it applies backpressure into the input queue.

Required Associated Types§

Source

type Interface: Interface

The message interface (see Service::Interface).

Required Methods§

Source

fn handle_message( &self, message: Self::Interface, ) -> impl Future<Output = ()> + Send

The asynchronous message handler for this service.

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§