Struct limiting_factor::kernel::Application
source · pub struct Application<U>where
U: Config,{ /* private fields */ }
Expand description
The application structure allows to encapsulate the service into a CLI application.
The application takes care to run the service and quits with a correct exit code.
It also takes care of initialisation logic like parse the environment to extract the configuration.
Implementations§
source§impl<U> Application<U>where
U: Config + EnvironmentConfigurable,
impl<U> Application<U>where U: Config + EnvironmentConfigurable,
pub fn new(config: U, routes: Vec<Route>) -> Self
sourcepub fn start(&mut self)
pub fn start(&mut self)
Starts the application
Exit codes
The software will exit with the following error codes:
- 0: Graceful exit (currently not in use, as the application never stops)
- 1: Error during the application run (e.g. routes conflict or Rocket fairings issues)
- 2: Error parsing the configuration (e.g. no database URL has been defined)
pub fn start_application(routes: Vec<Route>)
Auto Trait Implementations§
impl<U> !RefUnwindSafe for Application<U>
impl<U> !Send for Application<U>
impl<U> !Sync for Application<U>
impl<U> Unpin for Application<U>where U: Unpin,
impl<U> !UnwindSafe for Application<U>
Blanket Implementations§
§impl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
§fn into_collection<A>(self) -> SmallVec<A>where
A: Array<Item = T>,
fn into_collection<A>(self) -> SmallVec<A>where A: Array<Item = T>,
Converts
self
into a collection.