pub trait Service:
Sized
+ Send
+ Sync
+ 'static {
type Message: Send + 'static;
type ClientMethods: ClientMethods<Self>;
// Required methods
fn create(app: &App) -> Self;
fn handle(
self: Arc<Self>,
msg: Self::Message,
) -> impl Future<Output = ()> + Send;
// Provided methods
fn startup(self: Arc<Self>) -> impl Future<Output = ()> + Send { ... }
fn shutdown(self: Arc<Self>) -> impl Future<Output = ()> + Send { ... }
}Required Associated Types§
type Message: Send + 'static
type ClientMethods: ClientMethods<Self>
Required Methods§
Provided Methods§
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.