Switch to pin-project-lite

This commit is contained in:
Steven Fackler 2019-11-18 18:12:34 -08:00
parent 6e2435eb60
commit c98f605622
3 changed files with 19 additions and 17 deletions

View File

@ -42,7 +42,7 @@ futures-preview = { version = "=0.3.0-alpha.19", features = ["async-await"] }
log = "0.4"
parking_lot = "0.9"
percent-encoding = "2.0"
pin-project = "0.4"
pin-project-lite = "0.1"
phf = "0.8"
postgres-protocol = { version = "=0.5.0-alpha.1", path = "../postgres-protocol" }
postgres-types = { version = "=0.1.0-alpha.1", path = "../postgres-types" }

View File

@ -5,7 +5,7 @@ use crate::types::{IsNull, ToSql};
use crate::{Error, Portal, Row, Statement};
use bytes::{Bytes, BytesMut};
use futures::{ready, Stream};
use pin_project::pin_project;
use pin_project_lite::pin_project;
use postgres_protocol::message::backend::Message;
use postgres_protocol::message::frontend;
use std::marker::PhantomPinned;
@ -149,14 +149,15 @@ where
}
}
pin_project! {
/// A stream of table rows.
#[pin_project]
pub struct RowStream {
statement: Statement,
responses: Responses,
#[pin]
_p: PhantomPinned,
}
}
impl Stream for RowStream {
type Item = Result<Row, Error>;

View File

@ -5,7 +5,7 @@ use crate::{Error, SimpleQueryMessage, SimpleQueryRow};
use bytes::Bytes;
use fallible_iterator::FallibleIterator;
use futures::{ready, Stream};
use pin_project::pin_project;
use pin_project_lite::pin_project;
use postgres_protocol::message::backend::Message;
use postgres_protocol::message::frontend;
use std::marker::PhantomPinned;
@ -47,14 +47,15 @@ fn encode(client: &InnerClient, query: &str) -> Result<Bytes, Error> {
})
}
pin_project! {
/// A stream of simple query results.
#[pin_project]
pub struct SimpleQueryStream {
responses: Responses,
columns: Option<Arc<[String]>>,
#[pin]
_p: PhantomPinned,
}
}
impl Stream for SimpleQueryStream {
type Item = Result<SimpleQueryMessage, Error>;