File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,14 +16,14 @@ pub struct Connection {
1616 runtime : Runtime ,
1717 connection : Pin < Box < dyn Stream < Item = Result < AsyncMessage , Error > > + Send > > ,
1818 notifications : VecDeque < Notification > ,
19- notice_callback : Arc < dyn Fn ( DbError ) > ,
19+ notice_callback : Arc < dyn Fn ( DbError ) + Sync + Send > ,
2020}
2121
2222impl Connection {
2323 pub fn new < S , T > (
2424 runtime : Runtime ,
2525 connection : tokio_postgres:: Connection < S , T > ,
26- notice_callback : Arc < dyn Fn ( DbError ) > ,
26+ notice_callback : Arc < dyn Fn ( DbError ) + Sync + Send > ,
2727 ) -> Connection
2828 where
2929 S : AsyncRead + AsyncWrite + Unpin + ' static + Send ,
Original file line number Diff line number Diff line change @@ -499,3 +499,12 @@ fn explicit_close() {
499499 let client = Client :: connect ( "host=localhost port=5433 user=postgres" , NoTls ) . unwrap ( ) ;
500500 client. close ( ) . unwrap ( ) ;
501501}
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