pub trait Application: Sized {
type Err: Send + 'static;
type Config: Config;
type Options: Options;
// Required methods
fn new(_: Self::Options, _: Self::Config) -> Result<Self, Self::Err>;
fn run_once(&mut self, context: &Context) -> Result<Stopping, Self::Err>;
// Provided methods
fn signals() -> &'static [Signal] { ... }
fn received_signal(&mut self, _: Signal) { ... }
fn shutdown(self) -> Result<(), Self::Err> { ... }
}
Expand description
The application; domain-specific program logic
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn signals() -> &'static [Signal]
fn signals() -> &'static [Signal]
Which signal the application is interested in receiving.
By default, only INT and TERM are blocked and handled.
Sourcefn received_signal(&mut self, _: Signal)
fn received_signal(&mut self, _: Signal)
Handle a received signal
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.