pub struct DatabaseConfigBuilder { /* private fields */ }Expand description
Builder for DatabaseConfig.
Implementations§
Source§impl DatabaseConfigBuilder
impl DatabaseConfigBuilder
Sourcepub fn url_env(self, url_env: impl Into<String>) -> Self
pub fn url_env(self, url_env: impl Into<String>) -> Self
Sets the environment variable name that holds the database URL.
Sourcepub const fn pool_size(self, pool_size: u32) -> Self
pub const fn pool_size(self, pool_size: u32) -> Self
Sets the maximum number of connections in the pool.
Sourcepub fn pool_timeout(self, pool_timeout: impl Into<String>) -> Self
pub fn pool_timeout(self, pool_timeout: impl Into<String>) -> Self
Sets how long to wait for a connection before returning an error.
Sourcepub fn statement_timeout(self, statement_timeout: impl Into<String>) -> Self
pub fn statement_timeout(self, statement_timeout: impl Into<String>) -> Self
Sets the per-query statement timeout.
Sourcepub fn replica(self, replica: ReplicaConfig) -> Self
pub fn replica(self, replica: ReplicaConfig) -> Self
Adds a read replica.
Sourcepub fn health_check_interval(
self,
health_check_interval: impl Into<String>,
) -> Self
pub fn health_check_interval( self, health_check_interval: impl Into<String>, ) -> Self
Sets the health-check ping interval.
Sourcepub fn build(self) -> Result<DatabaseConfig, String>
pub fn build(self) -> Result<DatabaseConfig, String>
Trait Implementations§
Source§impl Debug for DatabaseConfigBuilder
impl Debug for DatabaseConfigBuilder
Source§impl Default for DatabaseConfigBuilder
impl Default for DatabaseConfigBuilder
Source§fn default() -> DatabaseConfigBuilder
fn default() -> DatabaseConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DatabaseConfigBuilder
impl RefUnwindSafe for DatabaseConfigBuilder
impl Send for DatabaseConfigBuilder
impl Sync for DatabaseConfigBuilder
impl Unpin for DatabaseConfigBuilder
impl UnsafeUnpin for DatabaseConfigBuilder
impl UnwindSafe for DatabaseConfigBuilder
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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