Changeset View
Changeset View
Standalone View
Standalone View
src/lib.rs
Show All 22 Lines | |||||
//! DefaultApplication::start_application(routes); | //! DefaultApplication::start_application(routes); | ||||
//! } | //! } | ||||
//! | //! | ||||
//! #[get("/status")] | //! #[get("/status")] | ||||
//! pub fn status() -> &'static str { | //! pub fn status() -> &'static str { | ||||
//! "ALIVE" | //! "ALIVE" | ||||
//! } | //! } | ||||
//! ``` | //! ``` | ||||
//! | |||||
//! Replacing `DefaultApplication` by `MinimalApplication` allows to use a lighter version | |||||
//! of the library without Diesel dependencies or database use. | |||||
#[cfg(feature = "pgsql")] | |||||
extern crate diesel; | extern crate diesel; | ||||
extern crate dotenv; | extern crate dotenv; | ||||
#[macro_use] extern crate log; | #[macro_use] | ||||
extern crate log; | |||||
#[cfg(feature = "pgsql")] | |||||
extern crate r2d2; | extern crate r2d2; | ||||
extern crate rocket; | extern crate rocket; | ||||
extern crate rocket_contrib; | extern crate rocket_contrib; | ||||
/* ------------------------------------------------------------- | /* ------------------------------------------------------------- | ||||
Public modules offered by this crate | Public modules offered by this crate | ||||
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ | ||||
pub mod api; | pub mod api; | ||||
pub mod config; | pub mod config; | ||||
pub mod database; | |||||
pub mod kernel; | pub mod kernel; | ||||
/* ------------------------------------------------------------- | /* ------------------------------------------------------------- | ||||
Optional public features modules offered by this crate | |||||
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ | |||||
#[cfg(feature = "pgsql")] | |||||
pub mod database; | |||||
/* ------------------------------------------------------------- | |||||
Custom types | Custom types | ||||
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ | ||||
pub type ErrorResult<T> = Result<T, Box<dyn std::error::Error>>; | pub type ErrorResult<T> = Result<T, Box<dyn std::error::Error>>; |
Nasqueron DevCentral · If it had been much bigger the moon would have had a core of ice. · Powered by Phabricator