11use futures:: sync:: mpsc;
22use futures:: { Async , Poll , Stream } ;
3- use postgres_protocol:: message:: backend:: Message ;
3+ use postgres_protocol:: message:: backend:: { DataRowBody , Message } ;
44use std:: mem;
55
66use crate :: proto:: client:: { Client , PendingRequest } ;
7- use crate :: { Error , StringRow } ;
7+ use crate :: Error ;
88
99pub enum State {
1010 Start {
@@ -20,10 +20,10 @@ pub enum State {
2020pub struct SimpleQueryStream ( State ) ;
2121
2222impl Stream for SimpleQueryStream {
23- type Item = StringRow ;
23+ type Item = DataRowBody ;
2424 type Error = Error ;
2525
26- fn poll ( & mut self ) -> Poll < Option < StringRow > , Error > {
26+ fn poll ( & mut self ) -> Poll < Option < DataRowBody > , Error > {
2727 loop {
2828 match mem:: replace ( & mut self . 0 , State :: Done ) {
2929 State :: Start { client, request } => {
@@ -48,8 +48,7 @@ impl Stream for SimpleQueryStream {
4848 }
4949 Some ( Message :: DataRow ( body) ) => {
5050 self . 0 = State :: ReadResponse { receiver } ;
51- let row = StringRow :: new ( body) ?;
52- return Ok ( Async :: Ready ( Some ( row) ) ) ;
51+ return Ok ( Async :: Ready ( Some ( body) ) ) ;
5352 }
5453 Some ( Message :: ErrorResponse ( body) ) => return Err ( Error :: db ( body) ) ,
5554 Some ( Message :: ReadyForQuery ( _) ) => return Ok ( Async :: Ready ( None ) ) ,
0 commit comments