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(self) -> Result<(), Box<dyn Error + Sync + Send>>;
// 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(self) -> Result<(), Box<dyn Error + Sync + Send>>
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.