11use std:: io:: { self , BufRead as _, IoSlice , Read , Write } ;
2- use std:: ops:: { Deref , DerefMut } ;
32use std:: pin:: Pin ;
43use std:: task:: { Context , Poll } ;
54
6- use rustls:: { ConnectionCommon , SideData } ;
5+ use rustls:: Connection as RustlsConnection ;
76use tokio:: io:: { AsyncBufRead , AsyncRead , AsyncWrite , ReadBuf } ;
87
98mod handshake;
@@ -66,10 +65,9 @@ pub(crate) struct Stream<'a, IO, C> {
6665 pub ( crate ) need_flush : bool ,
6766}
6867
69- impl < ' a , IO : AsyncRead + AsyncWrite + Unpin , C , SD > Stream < ' a , IO , C >
68+ impl < ' a , IO : AsyncRead + AsyncWrite + Unpin , C > Stream < ' a , IO , C >
7069where
71- C : DerefMut + Deref < Target = ConnectionCommon < SD > > ,
72- SD : SideData ,
70+ C : RustlsConnection ,
7371{
7472 pub ( crate ) fn new ( io : & ' a mut IO , session : & ' a mut C ) -> Self {
7573 Stream {
@@ -188,10 +186,7 @@ where
188186 }
189187 }
190188
191- pub ( crate ) fn poll_fill_buf ( mut self , cx : & mut Context < ' _ > ) -> Poll < io:: Result < & ' a [ u8 ] > >
192- where
193- SD : ' a ,
194- {
189+ pub ( crate ) fn poll_fill_buf ( mut self , cx : & mut Context < ' _ > ) -> Poll < io:: Result < & ' a [ u8 ] > > {
195190 let mut io_pending = false ;
196191
197192 // read a packet
@@ -231,10 +226,9 @@ where
231226 }
232227}
233228
234- impl < ' a , IO : AsyncRead + AsyncWrite + Unpin , C , SD > AsyncRead for Stream < ' a , IO , C >
229+ impl < ' a , IO : AsyncRead + AsyncWrite + Unpin , C > AsyncRead for Stream < ' a , IO , C >
235230where
236- C : DerefMut + Deref < Target = ConnectionCommon < SD > > ,
237- SD : SideData + ' a ,
231+ C : RustlsConnection + ' a ,
238232{
239233 fn poll_read (
240234 mut self : Pin < & mut Self > ,
@@ -249,10 +243,9 @@ where
249243 }
250244}
251245
252- impl < ' a , IO : AsyncRead + AsyncWrite + Unpin , C , SD > AsyncBufRead for Stream < ' a , IO , C >
246+ impl < ' a , IO : AsyncRead + AsyncWrite + Unpin , C > AsyncBufRead for Stream < ' a , IO , C >
253247where
254- C : DerefMut + Deref < Target = ConnectionCommon < SD > > ,
255- SD : SideData + ' a ,
248+ C : RustlsConnection + ' a ,
256249{
257250 fn poll_fill_buf ( self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < io:: Result < & [ u8 ] > > {
258251 let this = self . get_mut ( ) ;
@@ -270,10 +263,9 @@ where
270263 }
271264}
272265
273- impl < IO : AsyncRead + AsyncWrite + Unpin , C , SD > AsyncWrite for Stream < ' _ , IO , C >
266+ impl < IO : AsyncRead + AsyncWrite + Unpin , C > AsyncWrite for Stream < ' _ , IO , C >
274267where
275- C : DerefMut + Deref < Target = ConnectionCommon < SD > > ,
276- SD : SideData ,
268+ C : RustlsConnection ,
277269{
278270 fn poll_write (
279271 mut self : Pin < & mut Self > ,
0 commit comments