pub trait ServiceTask: Sync + Send {
// Required methods
fn get_service_name(&self) -> String;
fn run(
&self,
context: &ServiceTaskContext,
) -> impl Future<Output = ()> + Send;
// Provided method
fn on_wait_end(&self) -> impl Future<Output = ()> + Send { ... }
}Expand description
Defines service task behavior.
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
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".