[][src]Struct limiting_factor::kernel::Application

pub struct Application<U> where
    U: Config
{ /* fields omitted */ }

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.

Methods

impl<U> Application<U> where
    U: Config + EnvironmentConfigurable
[src]

pub fn new(config: U, routes: Vec<Route>) -> Self[src]

pub fn start(&mut self)[src]

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>)[src]

Auto Trait Implementations

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>

impl<U> !RefUnwindSafe for Application<U>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Typeable for T where
    T: Any

impl<T> IntoCollection<T> for T

impl<T, I> AsResult<T, I> for T where
    I: Input,