pub struct AppConfig {
pub host: String,
pub port: u16,
pub database_url: String,
pub db_max_connections: u32,
pub db_min_connections: u32,
pub db_connect_timeout: u64,
pub db_idle_timeout: u64,
pub db_max_lifetime: u64,
}Expand description
Application configuration loaded from environment variables.
Fields§
§host: StringServer bind host (from APP_HOST, default: 0.0.0.0).
port: u16Server bind port (from APP_PORT, default: 3000).
database_url: StringPostgreSQL connection string (from DATABASE_URL, required).
db_max_connections: u32Maximum database connections (from DB_MAX_CONNECTIONS, default: 100).
db_min_connections: u32Minimum database connections (from DB_MIN_CONNECTIONS, default: 5).
db_connect_timeout: u64Connection timeout in seconds (from DB_CONNECT_TIMEOUT, default: 8).
db_idle_timeout: u64Idle connection timeout in seconds (from DB_IDLE_TIMEOUT, default: 600).
db_max_lifetime: u64Maximum connection lifetime in seconds (from DB_MAX_LIFETIME, default: 1800).
Implementations§
Trait Implementations§
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