pub struct AppConfig {
pub environment: Environment,
pub debug: bool,
pub port: u16,
pub host: String,
pub database_url: Option<String>,
pub redis_url: Option<String>,
pub log_level: String,
pub secret_key: Option<String>,
}Expand description
Default application configuration
Fields§
§environment: Environment§debug: bool§port: u16§host: String§database_url: Option<String>§redis_url: Option<String>§log_level: String§secret_key: Option<String>Implementations§
Source§impl AppConfig
impl AppConfig
Sourcepub fn development() -> AppConfig
pub fn development() -> AppConfig
Create configuration for development
Sourcepub fn production() -> AppConfig
pub fn production() -> AppConfig
Create configuration for production
Sourcepub fn bind_address(&self) -> String
pub fn bind_address(&self) -> String
Get the bind address
Sourcepub fn has_database(&self) -> bool
pub fn has_database(&self) -> bool
Check if database is configured
Trait Implementations§
Source§impl AppConfigTrait for AppConfig
impl AppConfigTrait for AppConfig
Source§fn config_sources(&self) -> HashMap<String, ConfigSource>
fn config_sources(&self) -> HashMap<String, ConfigSource>
Get configuration source information for debugging
Auto Trait Implementations§
impl Freeze for AppConfig
impl RefUnwindSafe for AppConfig
impl Send for AppConfig
impl Sync for AppConfig
impl Unpin for AppConfig
impl UnwindSafe for AppConfig
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 more