File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
examples/postgres/pooled-with-rustls/src Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -11,10 +11,8 @@ use std::time::Duration;
11
11
async fn main ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
12
12
let db_url = std:: env:: var ( "DATABASE_URL" ) . expect ( "Env var `DATABASE_URL` not set" ) ;
13
13
14
- let config = ManagerConfig {
15
- custom_setup : Box :: new ( establish_connection) ,
16
- ..ManagerConfig :: default ( )
17
- } ;
14
+ let mut config = ManagerConfig :: default ( ) ;
15
+ config. custom_setup = Box :: new ( establish_connection) ;
18
16
19
17
// First we have to construct a connection manager with our custom `establish_connection`
20
18
// function
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ pub trait BlockOn {
30
30
fn get_runtime ( ) -> Self ;
31
31
}
32
32
33
- /// A helper type that wraps an [`crate::AsyncConnectionWrapper` ] to
33
+ /// A helper type that wraps an [`AsyncConnection`][ crate::AsyncConnection ] to
34
34
/// provide a sync [`diesel::Connection`] implementation.
35
35
///
36
36
/// Internally this wrapper type will use `block_on` to wait for
Original file line number Diff line number Diff line change @@ -85,8 +85,10 @@ impl<C: fmt::Debug> fmt::Debug for RecyclingMethod<C> {
85
85
86
86
/// Configuration object for a Manager.
87
87
///
88
- /// This currently only makes it possible to specify which [`RecyclingMethod`]
89
- /// should be used when retrieving existing objects from the [`Pool`].
88
+ /// This makes it possible to specify which [`RecyclingMethod`]
89
+ /// should be used when retrieving existing objects from the `Pool`
90
+ /// and it allows to provide a custom setup function.
91
+ #[ non_exhaustive]
90
92
pub struct ManagerConfig < C > {
91
93
/// Method of how a connection is recycled. See [RecyclingMethod].
92
94
pub recycling_method : RecyclingMethod < C > ,
You can’t perform that action at this time.
0 commit comments