Move futures/streams to a submodule
This commit is contained in:
@@ -2,10 +2,11 @@ use bytes::{Buf, Bytes};
|
||||
use futures::stream::{self, Stream};
|
||||
use std::io::{self, BufRead, Cursor, Read};
|
||||
use std::marker::PhantomData;
|
||||
use tokio_postgres::impls;
|
||||
use tokio_postgres::Error;
|
||||
|
||||
pub struct CopyOutReader<'a> {
|
||||
it: stream::Wait<tokio_postgres::CopyOut>,
|
||||
it: stream::Wait<impls::CopyOut>,
|
||||
cur: Cursor<Bytes>,
|
||||
_p: PhantomData<&'a mut ()>,
|
||||
}
|
||||
@@ -17,7 +18,7 @@ impl<'a> Drop for CopyOutReader<'a> {
|
||||
|
||||
impl<'a> CopyOutReader<'a> {
|
||||
#[allow(clippy::new_ret_no_self)]
|
||||
pub(crate) fn new(stream: tokio_postgres::CopyOut) -> Result<CopyOutReader<'a>, Error> {
|
||||
pub(crate) fn new(stream: impls::CopyOut) -> Result<CopyOutReader<'a>, Error> {
|
||||
let mut it = stream.wait();
|
||||
let cur = match it.next() {
|
||||
Some(Ok(cur)) => cur,
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
use fallible_iterator::FallibleIterator;
|
||||
use futures::stream::{self, Stream};
|
||||
use std::marker::PhantomData;
|
||||
use tokio_postgres::impls;
|
||||
use tokio_postgres::{Error, Row};
|
||||
|
||||
pub struct Query<'a> {
|
||||
it: stream::Wait<tokio_postgres::Query>,
|
||||
it: stream::Wait<impls::Query>,
|
||||
_p: PhantomData<&'a mut ()>,
|
||||
}
|
||||
|
||||
@@ -14,7 +15,7 @@ impl<'a> Drop for Query<'a> {
|
||||
}
|
||||
|
||||
impl<'a> Query<'a> {
|
||||
pub(crate) fn new(stream: tokio_postgres::Query) -> Query<'a> {
|
||||
pub(crate) fn new(stream: impls::Query) -> Query<'a> {
|
||||
Query {
|
||||
it: stream.wait(),
|
||||
_p: PhantomData,
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
use fallible_iterator::FallibleIterator;
|
||||
use futures::stream::{self, Stream};
|
||||
use std::marker::PhantomData;
|
||||
use tokio_postgres::impls;
|
||||
use tokio_postgres::{Error, Row};
|
||||
|
||||
pub struct QueryPortal<'a> {
|
||||
it: stream::Wait<tokio_postgres::QueryPortal>,
|
||||
it: stream::Wait<impls::QueryPortal>,
|
||||
_p: PhantomData<&'a mut ()>,
|
||||
}
|
||||
|
||||
@@ -14,7 +15,7 @@ impl<'a> Drop for QueryPortal<'a> {
|
||||
}
|
||||
|
||||
impl<'a> QueryPortal<'a> {
|
||||
pub(crate) fn new(stream: tokio_postgres::QueryPortal) -> QueryPortal<'a> {
|
||||
pub(crate) fn new(stream: impls::QueryPortal) -> QueryPortal<'a> {
|
||||
QueryPortal {
|
||||
it: stream.wait(),
|
||||
_p: PhantomData,
|
||||
|
||||
Reference in New Issue
Block a user