pub trait Service:
Sized
+ Send
+ 'static {
type Error: Error + Send + Sync + 'static;
// Required methods
fn initialize(
context: ExecutionContext,
) -> impl Future<Output = Result<Self, Self::Error>> + Send;
fn run(
&mut self,
context: ExecutionContext,
) -> impl Future<Output = Result<(), Self::Error>> + Send;
// Provided methods
fn stop(&mut self) -> impl Future<Output = Result<(), Self::Error>> + Send { ... }
fn cleanup(
&mut self,
) -> impl Future<Output = Result<(), Self::Error>> + Send { ... }
}Required Associated Types§
Required Methods§
fn initialize( context: ExecutionContext, ) -> impl Future<Output = Result<Self, Self::Error>> + Send
fn run( &mut self, context: ExecutionContext, ) -> impl Future<Output = Result<(), Self::Error>> + Send
Provided Methods§
fn stop(&mut self) -> impl Future<Output = Result<(), Self::Error>> + Send
fn cleanup(&mut self) -> impl Future<Output = Result<(), Self::Error>> + Send
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".