Trait system_service::Application [] [src]

pub trait Application: Sized {
    type Err: Send + 'static;
    type Config: Config;
    type Options: Options;
    fn new(_: Self::Options, _: Self::Config) -> Result<Self, Self::Err>;
fn run_once(&mut self, context: &Context) -> Result<Stopping, Self::Err>; fn signals() -> &'static [Signal] { ... }
fn received_signal(&mut self, _: Signal) { ... }
fn shutdown(self) -> Result<(), Self::Err> { ... } }

The application; domain-specific program logic

Associated Types

Main error export of the Application

Config to be loaded from a file

Options from the command line

Required Methods

Create a new instance given the options and config

Called repeatedly in the main loop of the application.

Provided Methods

Which signal the application is interested in receiving.

By default, only INT and TERM are blocked and handled.

Handle a received signal

Called when the application is shutting down

Implementors