pub trait Service<Global>:
Send
+ Sync
+ 'static
+ Sized {
// Provided methods
fn name(&self) -> Option<&'static str> { ... }
fn enabled(
&self,
global: &Arc<Global>,
) -> impl Future<Output = Result<bool>> + Send { ... }
fn run(
self,
global: Arc<Global>,
ctx: Context,
) -> impl Future<Output = Result<()>> + Send + 'static { ... }
}
Provided Methods§
fn name(&self) -> Option<&'static str>
Sourcefn enabled(
&self,
global: &Arc<Global>,
) -> impl Future<Output = Result<bool>> + Send
fn enabled( &self, global: &Arc<Global>, ) -> impl Future<Output = Result<bool>> + Send
Initialize the service
fn run( self, global: Arc<Global>, ctx: Context, ) -> impl Future<Output = Result<()>> + Send + 'static
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.