Struct r2d2::config::Builder
[−]
[src]
pub struct Builder<C, E> { // some 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> Builder<C, E>
fn new() -> Builder<C, E>
Constructs a new Builder
.
Parameters are initialized with their default values.
fn pool_size(self, pool_size: u32) -> Builder<C, E>
fn helper_threads(self, helper_threads: u32) -> Builder<C, E>
fn test_on_check_out(self, test_on_check_out: bool) -> Builder<C, E>
Sets test_on_check_out
.
fn initialization_fail_fast(self, initialization_fail_fast: bool) -> Builder<C, E>
Sets initialization_fail_fast
.
fn connection_timeout_ms(self, connection_timeout_ms: u32) -> Builder<C, E>
Sets connection_timeout_ms
to the specified number of milliseconds.
Panics
Panics if connection_timeout_ms
is 0.
fn error_handler(self, error_handler: Box<HandleError<E>>) -> Builder<C, E>
Sets the error_handler
.
fn connection_customizer(self, connection_customizer: Box<CustomizeConnection<C, E>>) -> Builder<C, E>
Sets the connection_customizer
.
fn build(self) -> Config<C, E>
Consumes the Builder
, turning it into a Config
.