1
+ //! Futures and stream types used in the crate.
1
2
use bytes:: { Bytes , IntoBuf } ;
2
3
use futures:: { try_ready, Async , Future , Poll , Stream } ;
3
4
use std:: error;
@@ -8,6 +9,7 @@ use crate::{Client, Connection, Error, Portal, Row, Statement, TlsConnect};
8
9
#[ cfg( feature = "runtime" ) ]
9
10
use crate :: { MakeTlsConnect , Socket } ;
10
11
12
+ /// The future returned by `Client::cancel_query_raw`.
11
13
#[ must_use = "futures do nothing unless polled" ]
12
14
pub struct CancelQueryRaw < S , T > ( pub ( crate ) proto:: CancelQueryRawFuture < S , T > )
13
15
where
27
29
}
28
30
}
29
31
32
+ /// The future returned by `Client::cancel_query`.
30
33
#[ cfg( feature = "runtime" ) ]
31
34
#[ must_use = "futures do nothing unless polled" ]
32
35
pub struct CancelQuery < T > ( pub ( crate ) proto:: CancelQueryFuture < T > )
46
49
}
47
50
}
48
51
52
+ /// The future returned by `Config::connect_raw`.
49
53
#[ must_use = "futures do nothing unless polled" ]
50
54
pub struct ConnectRaw < S , T > ( pub ( crate ) proto:: ConnectRawFuture < S , T > )
51
55
where
67
71
}
68
72
}
69
73
74
+ /// The future returned by `Config::connect`.
70
75
#[ cfg( feature = "runtime" ) ]
71
76
#[ must_use = "futures do nothing unless polled" ]
72
77
pub struct Connect < T > ( pub ( crate ) proto:: ConnectFuture < T > )
88
93
}
89
94
}
90
95
96
+ /// The future returned by `Client::prepare`.
91
97
#[ must_use = "futures do nothing unless polled" ]
92
98
pub struct Prepare ( pub ( crate ) proto:: PrepareFuture ) ;
93
99
@@ -102,6 +108,7 @@ impl Future for Prepare {
102
108
}
103
109
}
104
110
111
+ /// The future returned by `Client::query`.
105
112
#[ must_use = "streams do nothing unless polled" ]
106
113
pub struct Query ( pub ( crate ) proto:: QueryStream < proto:: Statement > ) ;
107
114
@@ -114,6 +121,7 @@ impl Stream for Query {
114
121
}
115
122
}
116
123
124
+ /// The future returned by `Client::bind`.
117
125
#[ must_use = "futures do nothing unless polled" ]
118
126
pub struct Bind ( pub ( crate ) proto:: BindFuture ) ;
119
127
@@ -130,6 +138,7 @@ impl Future for Bind {
130
138
}
131
139
}
132
140
141
+ /// The future returned by `Client::query_portal`.
133
142
#[ must_use = "streams do nothing unless polled" ]
134
143
pub struct QueryPortal ( pub ( crate ) proto:: QueryStream < proto:: Portal > ) ;
135
144
@@ -142,6 +151,7 @@ impl Stream for QueryPortal {
142
151
}
143
152
}
144
153
154
+ /// The future returned by `Client::copy_in`.
145
155
#[ must_use = "futures do nothing unless polled" ]
146
156
pub struct CopyIn < S > ( pub ( crate ) proto:: CopyInFuture < S > )
147
157
where
@@ -165,6 +175,7 @@ where
165
175
}
166
176
}
167
177
178
+ /// The future returned by `Client::copy_out`.
168
179
#[ must_use = "streams do nothing unless polled" ]
169
180
pub struct CopyOut ( pub ( crate ) proto:: CopyOutStream ) ;
170
181
0 commit comments