pub struct Config {Show 21 fields
pub name: String,
pub version: String,
pub domain: String,
pub address: SocketAddr,
pub assets: Assets,
pub tracing: Tracing,
pub routers: Routers,
pub auth: Auth,
pub oauth: Oauth,
pub registration: Registration,
pub comments: Comments,
pub email: Email,
pub mailing: Mailing,
pub payments: Payments,
pub company: Company,
pub plans: Vec<Plan>,
pub users: Vec<User>,
pub phrases: Vec<String>,
pub dev: DevMode,
pub init: Init,
pub routes: Routes,
}Expand description
Application configuration. Defines all the aspects of the application
that are to be handled on the micron level.
§Sensible defaults
Configuration provided through Config::default() allows for quick setup
of an application using the recommended workflow. It enables all available
features and sets default values for paths, addresses, etc.
Using the struct update syntax one can initialize a new Config, making
a few changes right in the definition.
let cfg = Config {
tracing: Tracing {
enabled: false,
..Default::default()
},
..Default::default()
}Fields§
§name: String§version: String§domain: StringDomain name pointing to the machine running the application.
address: SocketAddrAddress on which to serve the application. Defaults to
127.0.0.1:8080.
assets: Assets§tracing: Tracing§routers: Routers§auth: Auth§oauth: Oauth§registration: Registration§comments: Comments§email: Email§mailing: Mailing§payments: Payments§company: CompanyInformation about the company behind the application.
plans: Vec<Plan>List of available subscription plans.
users: Vec<User>List of initial users.
phrases: Vec<String>List of phrases/quotes to be showed randomly on the app pages, because why not.
dev: DevModeDevelopment mode configuration.
init: Init§routes: RoutesSelectively enable/disable pre-made routes
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().