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,

source

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

source

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)
source

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§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn as_result(self) -> Result<T, ParseErr<I>>

source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoCollection<T> for T

§

fn into_collection<A>(self) -> SmallVec<A>where A: Array<Item = T>,

Converts self into a collection.
§

fn mapped<U, F, A>(self, f: F) -> SmallVec<A>where F: FnMut(T) -> U, A: Array<Item = U>,

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Typeable for Twhere T: Any,

§

fn get_type(&self) -> TypeId

Get the TypeId of this object.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V