Trait ServiceManager

Source
pub trait ServiceManager {
    // Required methods
    fn register<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        exe: PathBuf,
        args: &'life1 [&'life2 str],
    ) -> Pin<Box<dyn Future<Output = Result<(), AnyError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn run<'async_trait>(
        self,
        launcher_paths: LauncherPaths,
        handle: impl 'async_trait + 'static + ServiceContainer,
    ) -> Pin<Box<dyn Future<Output = Result<(), AnyError>> + Send + 'async_trait>>
       where Self: 'async_trait;
    fn show_logs<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), AnyError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn is_installed<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<bool, AnyError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn unregister<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), AnyError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn register<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, exe: PathBuf, args: &'life1 [&'life2 str], ) -> Pin<Box<dyn Future<Output = Result<(), AnyError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Registers the current executable as a service to run with the given set of arguments.

Source

fn run<'async_trait>( self, launcher_paths: LauncherPaths, handle: impl 'async_trait + 'static + ServiceContainer, ) -> Pin<Box<dyn Future<Output = Result<(), AnyError>> + Send + 'async_trait>>
where Self: 'async_trait,

Runs the service using the given handle. The executable must not take any action which may fail prior to calling this to ensure service states may update.

Source

fn show_logs<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), AnyError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Show logs from the running service to standard out.

Source

fn is_installed<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<bool, AnyError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Gets whether the tunnel service is installed.

Source

fn unregister<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), AnyError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Unregisters the current executable as a service.

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§