File tree 2 files changed +11
-2
lines changed
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -16,14 +16,14 @@ pub struct Connection {
16
16
runtime : Runtime ,
17
17
connection : Pin < Box < dyn Stream < Item = Result < AsyncMessage , Error > > + Send > > ,
18
18
notifications : VecDeque < Notification > ,
19
- notice_callback : Arc < dyn Fn ( DbError ) > ,
19
+ notice_callback : Arc < dyn Fn ( DbError ) + Sync + Send > ,
20
20
}
21
21
22
22
impl Connection {
23
23
pub fn new < S , T > (
24
24
runtime : Runtime ,
25
25
connection : tokio_postgres:: Connection < S , T > ,
26
- notice_callback : Arc < dyn Fn ( DbError ) > ,
26
+ notice_callback : Arc < dyn Fn ( DbError ) + Sync + Send > ,
27
27
) -> Connection
28
28
where
29
29
S : AsyncRead + AsyncWrite + Unpin + ' static + Send ,
Original file line number Diff line number Diff line change @@ -499,3 +499,12 @@ fn explicit_close() {
499
499
let client = Client :: connect ( "host=localhost port=5433 user=postgres" , NoTls ) . unwrap ( ) ;
500
500
client. close ( ) . unwrap ( ) ;
501
501
}
502
+
503
+ #[ test]
504
+ fn check_send ( ) {
505
+ fn is_send < T : Send > ( ) { }
506
+
507
+ is_send :: < Client > ( ) ;
508
+ is_send :: < Statement > ( ) ;
509
+ is_send :: < Transaction < ' _ > > ( ) ;
510
+ }
You can’t perform that action at this time.
0 commit comments