pub trait ServiceTask: Sync + Send {
// Required methods
fn get_service_name(&self) -> String;
fn run(&self, context: &ServiceContext) -> impl Future<Output = ()> + Send;
// Provided methods
fn on_wait_end(&self) -> impl Future<Output = ()> + Send { ... }
fn get_join_time(&self) -> Duration { ... }
}
Required Methods§
Sourcefn get_service_name(&self) -> String
fn get_service_name(&self) -> String
Get the service name
Provided Methods§
Sourcefn on_wait_end(&self) -> impl Future<Output = ()> + Send
fn on_wait_end(&self) -> impl Future<Output = ()> + Send
override for custom behavior
Sourcefn get_join_time(&self) -> Duration
fn get_join_time(&self) -> Duration
Get join time for shutdown (default 90 seconds)
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.