Struct r2d2::config::Builder
[−]
[src]
pub struct Builder<C, E> { /* fields omitted */ }
A builder for Config
.
See the documentation of Config
for more details about the default value
and meaning of the configuration parameters.
Methods
impl<C, E: Error> Builder<C, E>
[src]
fn new() -> Builder<C, E>
[src]
Constructs a new Builder
.
Parameters are initialized with their default values.
fn pool_size(self, pool_size: u32) -> Builder<C, E>
[src]
fn min_idle(self, min_idle: Option<u32>) -> Builder<C, E>
[src]
Sets min_idle
.
fn helper_threads(self, helper_threads: u32) -> Builder<C, E>
[src]
fn thread_pool(
self,
thread_pool: Option<Arc<ScheduledThreadPool>>
) -> Builder<C, E>
[src]
self,
thread_pool: Option<Arc<ScheduledThreadPool>>
) -> Builder<C, E>
Sets the thread_pool
.
fn test_on_check_out(self, test_on_check_out: bool) -> Builder<C, E>
[src]
Sets test_on_check_out
.
fn initialization_fail_fast(
self,
initialization_fail_fast: bool
) -> Builder<C, E>
[src]
self,
initialization_fail_fast: bool
) -> Builder<C, E>
Sets initialization_fail_fast
.
fn max_lifetime(self, max_lifetime: Option<Duration>) -> Builder<C, E>
[src]
fn idle_timeout(self, idle_timeout: Option<Duration>) -> Builder<C, E>
[src]
fn connection_timeout(self, connection_timeout: Duration) -> Builder<C, E>
[src]
Sets connection_timeout
to the specified duration.
Panics
Panics if connection_timeout
is the zero duration
fn error_handler(self, error_handler: Box<HandleError<E>>) -> Builder<C, E>
[src]
Sets the error_handler
.
fn connection_customizer(
self,
connection_customizer: Box<CustomizeConnection<C, E>>
) -> Builder<C, E>
[src]
self,
connection_customizer: Box<CustomizeConnection<C, E>>
) -> Builder<C, E>
Sets the connection_customizer
.