File tree Expand file tree Collapse file tree 2 files changed +20
-14
lines changed Expand file tree Collapse file tree 2 files changed +20
-14
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,19 @@ impl Stream for Query {
121
121
}
122
122
}
123
123
124
+ /// The future returned by `Client::execute`.
125
+ #[ must_use = "futures do nothing unless polled" ]
126
+ pub struct Execute ( pub ( crate ) proto:: ExecuteFuture ) ;
127
+
128
+ impl Future for Execute {
129
+ type Item = u64 ;
130
+ type Error = Error ;
131
+
132
+ fn poll ( & mut self ) -> Poll < u64 , Error > {
133
+ self . 0 . poll ( )
134
+ }
135
+ }
136
+
124
137
/// The future returned by `Client::bind`.
125
138
#[ must_use = "futures do nothing unless polled" ]
126
139
pub struct Bind ( pub ( crate ) proto:: BindFuture ) ;
Original file line number Diff line number Diff line change @@ -182,8 +182,8 @@ impl Client {
182
182
/// # Panics
183
183
///
184
184
/// Panics if the number of parameters provided does not match the number expected.
185
- pub fn execute ( & mut self , statement : & Statement , params : & [ & dyn ToSql ] ) -> Execute {
186
- Execute ( self . 0 . execute ( & statement. 0 , params) )
185
+ pub fn execute ( & mut self , statement : & Statement , params : & [ & dyn ToSql ] ) -> impls :: Execute {
186
+ impls :: Execute ( self . 0 . execute ( & statement. 0 , params) )
187
187
}
188
188
189
189
/// Executes a statement, returning a stream of the resulting rows.
@@ -396,18 +396,6 @@ impl Statement {
396
396
}
397
397
}
398
398
399
- #[ must_use = "futures do nothing unless polled" ]
400
- pub struct Execute ( proto:: ExecuteFuture ) ;
401
-
402
- impl Future for Execute {
403
- type Item = u64 ;
404
- type Error = Error ;
405
-
406
- fn poll ( & mut self ) -> Poll < u64 , Error > {
407
- self . 0 . poll ( )
408
- }
409
- }
410
-
411
399
/// A portal.
412
400
///
413
401
/// Portals can only be used with the connection that created them, and only exist for the duration of the transaction
@@ -447,8 +435,13 @@ where
447
435
}
448
436
}
449
437
438
+ /// Message returned by the `SimpleQuery` stream.
450
439
pub enum SimpleQueryMessage {
440
+ /// A row of data.
451
441
Row ( SimpleQueryRow ) ,
442
+ /// A statement in the query has completed.
443
+ ///
444
+ /// The number of rows modified or selected is returned.
452
445
CommandComplete ( u64 ) ,
453
446
#[ doc( hidden) ]
454
447
__NonExhaustive,
You can’t perform that action at this time.
0 commit comments