Service

Trait Service 

Source
pub trait Service: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    async fn start(&self) -> Result<()>;
    async fn stop(&self) -> Result<()>;
    async fn is_running(&self) -> bool;
}
Expand description

Service trait

Required Methods§

Source

fn name(&self) -> &str

Get service name

Source

async fn start(&self) -> Result<()>

Start the service

Source

async fn stop(&self) -> Result<()>

Stop the service

Source

async fn is_running(&self) -> bool

Check if service is running

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.

Implementors§