pub trait ServiceTrait: 'static {
type Item;
// Required methods
fn new() -> Self;
fn register(self, item: Self::Item) -> Self;
fn init<A>() -> Self
where A: ApplicationTrait;
fn run<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Sync + Send>>> + Send + 'async_trait>>
where Self: 'async_trait;
// Provided method
fn shutdown<'async_trait>( ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> { ... }
}
Required Associated Types§
Required Methods§
fn new() -> Self
fn register(self, item: Self::Item) -> Self
fn init<A>() -> Selfwhere
A: ApplicationTrait,
fn run<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Sync + Send>>> + Send + 'async_trait>>where
Self: 'async_trait,
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.