Skip to content

Commit 299ef6c

Browse files
committed
Rename CopyStream to CopyOutStream
1 parent ff3ea1c commit 299ef6c

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

postgres/src/copy_out_reader.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ use futures::executor;
33
use std::io::{self, BufRead, Cursor, Read};
44
use std::marker::PhantomData;
55
use std::pin::Pin;
6-
use tokio_postgres::{CopyStream, Error};
6+
use tokio_postgres::{CopyOutStream, Error};
77

88
/// The reader returned by the `copy_out` method.
99
pub struct CopyOutReader<'a> {
10-
it: executor::BlockingStream<Pin<Box<CopyStream>>>,
10+
it: executor::BlockingStream<Pin<Box<CopyOutStream>>>,
1111
cur: Cursor<Bytes>,
1212
_p: PhantomData<&'a mut ()>,
1313
}
@@ -18,7 +18,7 @@ impl Drop for CopyOutReader<'_> {
1818
}
1919

2020
impl<'a> CopyOutReader<'a> {
21-
pub(crate) fn new(stream: CopyStream) -> Result<CopyOutReader<'a>, Error> {
21+
pub(crate) fn new(stream: CopyOutStream) -> Result<CopyOutReader<'a>, Error> {
2222
let mut it = executor::block_on_stream(Box::pin(stream));
2323
let cur = match it.next() {
2424
Some(Ok(cur)) => cur,

tokio-postgres-binary-copy/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::pin::Pin;
88
use std::sync::Arc;
99
use std::task::{Context, Poll};
1010
use tokio_postgres::types::{IsNull, ToSql, Type, FromSql, WrongType};
11-
use tokio_postgres::{CopyStream, CopyInSink};
11+
use tokio_postgres::{CopyOutStream, CopyInSink};
1212
use std::io::Cursor;
1313
use byteorder::{ByteOrder, BigEndian};
1414

@@ -99,14 +99,14 @@ struct Header {
9999
pin_project! {
100100
pub struct BinaryCopyOutStream {
101101
#[pin]
102-
stream: CopyStream,
102+
stream: CopyOutStream,
103103
types: Arc<Vec<Type>>,
104104
header: Option<Header>,
105105
}
106106
}
107107

108108
impl BinaryCopyOutStream {
109-
pub fn new(types: &[Type], stream: CopyStream) -> BinaryCopyOutStream {
109+
pub fn new(types: &[Type], stream: CopyOutStream) -> BinaryCopyOutStream {
110110
BinaryCopyOutStream {
111111
stream,
112112
types: Arc::new(types.to_vec()),

tokio-postgres/src/client.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::cancel_query;
33
use crate::codec::BackendMessages;
44
use crate::config::{Host, SslMode};
55
use crate::connection::{Request, RequestMessages};
6-
use crate::copy_out::CopyStream;
6+
use crate::copy_out::CopyOutStream;
77
use crate::query::RowStream;
88
use crate::simple_query::SimpleQueryStream;
99
use crate::slice_iter;
@@ -370,7 +370,7 @@ impl Client {
370370
&self,
371371
statement: &T,
372372
params: &[&(dyn ToSql + Sync)],
373-
) -> Result<CopyStream, Error>
373+
) -> Result<CopyOutStream, Error>
374374
where
375375
T: ?Sized + ToStatement,
376376
{

tokio-postgres/src/copy_out.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ pub async fn copy_out<'a, I>(
1515
client: &InnerClient,
1616
statement: Statement,
1717
params: I,
18-
) -> Result<CopyStream, Error>
18+
) -> Result<CopyOutStream, Error>
1919
where
2020
I: IntoIterator<Item = &'a dyn ToSql>,
2121
I::IntoIter: ExactSizeIterator,
2222
{
2323
let buf = query::encode(client, &statement, params)?;
2424
let responses = start(client, buf).await?;
25-
Ok(CopyStream {
25+
Ok(CopyOutStream {
2626
responses,
2727
_p: PhantomPinned,
2828
})
@@ -46,14 +46,14 @@ async fn start(client: &InnerClient, buf: Bytes) -> Result<Responses, Error> {
4646

4747
pin_project! {
4848
/// A stream of `COPY ... TO STDOUT` query data.
49-
pub struct CopyStream {
49+
pub struct CopyOutStream {
5050
responses: Responses,
5151
#[pin]
5252
_p: PhantomPinned,
5353
}
5454
}
5555

56-
impl Stream for CopyStream {
56+
impl Stream for CopyOutStream {
5757
type Item = Result<Bytes, Error>;
5858

5959
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {

tokio-postgres/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ pub use crate::client::Client;
106106
pub use crate::config::Config;
107107
pub use crate::connection::Connection;
108108
pub use crate::copy_in::CopyInSink;
109-
pub use crate::copy_out::CopyStream;
109+
pub use crate::copy_out::CopyOutStream;
110110
use crate::error::DbError;
111111
pub use crate::error::Error;
112112
pub use crate::portal::Portal;

tokio-postgres/src/transaction.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::codec::FrontendMessage;
22
use crate::connection::RequestMessages;
3-
use crate::copy_out::CopyStream;
3+
use crate::copy_out::CopyOutStream;
44
use crate::query::RowStream;
55
#[cfg(feature = "runtime")]
66
use crate::tls::MakeTlsConnect;
@@ -226,7 +226,7 @@ impl<'a> Transaction<'a> {
226226
&self,
227227
statement: &T,
228228
params: &[&(dyn ToSql + Sync)],
229-
) -> Result<CopyStream, Error>
229+
) -> Result<CopyOutStream, Error>
230230
where
231231
T: ?Sized + ToStatement,
232232
{

0 commit comments

Comments
 (0)