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;
1111async fn main ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
1212 let db_url = std:: env:: var ( "DATABASE_URL" ) . expect ( "Env var `DATABASE_URL` not set" ) ;
1313
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) ;
1816
1917 // First we have to construct a connection manager with our custom `establish_connection`
2018 // function
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ pub trait BlockOn {
3030 fn get_runtime ( ) -> Self ;
3131}
3232
33- /// A helper type that wraps an [`crate::AsyncConnectionWrapper` ] to
33+ /// A helper type that wraps an [`AsyncConnection`][ crate::AsyncConnection ] to
3434/// provide a sync [`diesel::Connection`] implementation.
3535///
3636/// 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> {
8585
8686/// Configuration object for a Manager.
8787///
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]
9092pub struct ManagerConfig < C > {
9193 /// Method of how a connection is recycled. See [RecyclingMethod].
9294 pub recycling_method : RecyclingMethod < C > ,
You can’t perform that action at this time.
0 commit comments