@@ -22,7 +22,7 @@ pub struct SetServiceResponse<'a> {
22
22
/// It does, however, know just enough to be able to provide a higher-level interface than would otherwise be possible.
23
23
/// Thus the consumer of this trait will not have to deal with packet lines at all.
24
24
/// **Note that** whenever a `Read` trait or `Write` trait is produced, it must be exhausted.
25
- #[ async_trait( ? Send ) ]
25
+ #[ async_trait]
26
26
pub trait Transport : TransportWithoutIO {
27
27
/// Initiate connection to the given service.
28
28
/// Returns the service capabilities according according to the actual [Protocol] it supports,
@@ -37,8 +37,8 @@ pub trait Transport: TransportWithoutIO {
37
37
}
38
38
39
39
// Would be nice if the box implementation could auto-forward to all implemented traits.
40
- #[ async_trait( ? Send ) ]
41
- impl < T : Transport + ?Sized > Transport for Box < T > {
40
+ #[ async_trait]
41
+ impl < T : Transport + ?Sized + Send > Transport for Box < T > {
42
42
async fn handshake ( & mut self , service : Service ) -> Result < SetServiceResponse < ' _ > , Error > {
43
43
self . deref_mut ( ) . handshake ( service) . await
44
44
}
@@ -49,27 +49,27 @@ impl<T: Transport + ?Sized> Transport for Box<T> {
49
49
}
50
50
51
51
/// An extension trait to add more methods to everything implementing [`Transport`].
52
- #[ async_trait( ? Send ) ]
52
+ #[ async_trait]
53
53
pub trait TransportV2Ext {
54
54
/// Invoke a protocol V2 style `command` with given `capabilities` and optional command specific `arguments`.
55
55
/// The `capabilities` were communicated during the handshake.
56
56
/// _Note:_ panics if [handshake][Transport::handshake()] wasn't performed beforehand.
57
57
async fn invoke < ' a > (
58
58
& mut self ,
59
59
command : & str ,
60
- capabilities : impl Iterator < Item = ( & ' a str , Option < & ' a str > ) > + ' a ,
61
- arguments : Option < impl Iterator < Item = bstr:: BString > + ' a > ,
62
- ) -> Result < Box < dyn ExtendedBufRead + Unpin + ' _ > , Error > ;
60
+ capabilities : impl Iterator < Item = ( & ' a str , Option < & ' a str > ) > + ' a + Send ,
61
+ arguments : Option < impl Iterator < Item = bstr:: BString > + ' a + Send > ,
62
+ ) -> Result < Box < dyn ExtendedBufRead + Unpin + ' _ + Send > , Error > ;
63
63
}
64
64
65
- #[ async_trait( ? Send ) ]
66
- impl < T : Transport > TransportV2Ext for T {
65
+ #[ async_trait]
66
+ impl < T : Transport + Send > TransportV2Ext for T {
67
67
async fn invoke < ' a > (
68
68
& mut self ,
69
69
command : & str ,
70
- capabilities : impl Iterator < Item = ( & ' a str , Option < & ' a str > ) > + ' a ,
71
- arguments : Option < impl Iterator < Item = BString > + ' a > ,
72
- ) -> Result < Box < dyn ExtendedBufRead + Unpin + ' _ > , Error > {
70
+ capabilities : impl Iterator < Item = ( & ' a str , Option < & ' a str > ) > + ' a + Send ,
71
+ arguments : Option < impl Iterator < Item = BString > + ' a + Send > ,
72
+ ) -> Result < Box < dyn ExtendedBufRead + Unpin + ' _ + Send > , Error > {
73
73
let mut writer = self . request ( WriteMode :: OneLfTerminatedLinePerWriteCall , MessageKind :: Flush ) ?;
74
74
writer. write_all ( format ! ( "command={}" , command) . as_bytes ( ) ) . await ?;
75
75
for ( name, value) in capabilities {
0 commit comments