This commit is contained in:
Steven Fackler 2019-12-04 18:59:22 -08:00
parent 5c33bf8b30
commit 0c84ed9f82
4 changed files with 8 additions and 26 deletions

View File

@ -384,10 +384,7 @@ impl Client {
/// # Panics
///
/// Panics if the statement contains parameters.
pub async fn copy_in<T, U>(
&self,
statement: &T,
) -> Result<CopyInSink<U>, Error>
pub async fn copy_in<T, U>(&self, statement: &T) -> Result<CopyInSink<U>, Error>
where
T: ?Sized + ToStatement,
U: Buf + 'static + Send,
@ -403,10 +400,7 @@ impl Client {
/// # Panics
///
/// Panics if the statement contains parameters.
pub async fn copy_out<T>(
&self,
statement: &T,
) -> Result<CopyOutStream, Error>
pub async fn copy_out<T>(&self, statement: &T) -> Result<CopyOutStream, Error>
where
T: ?Sized + ToStatement,
{

View File

@ -1,7 +1,7 @@
use crate::client::{InnerClient, Responses};
use crate::codec::FrontendMessage;
use crate::connection::RequestMessages;
use crate::{query, Error, Statement, slice_iter};
use crate::{query, slice_iter, Error, Statement};
use bytes::buf::BufExt;
use bytes::{Buf, BufMut, BytesMut};
use futures::channel::mpsc;
@ -195,10 +195,7 @@ where
}
}
pub async fn copy_in<T>(
client: &InnerClient,
statement: Statement,
) -> Result<CopyInSink<T>, Error>
pub async fn copy_in<T>(client: &InnerClient, statement: Statement) -> Result<CopyInSink<T>, Error>
where
T: Buf + 'static + Send,
{

View File

@ -1,7 +1,7 @@
use crate::client::{InnerClient, Responses};
use crate::codec::FrontendMessage;
use crate::connection::RequestMessages;
use crate::{query, Error, Statement, slice_iter};
use crate::{query, slice_iter, Error, Statement};
use bytes::Bytes;
use futures::{ready, Stream};
use pin_project_lite::pin_project;
@ -10,10 +10,7 @@ use std::marker::PhantomPinned;
use std::pin::Pin;
use std::task::{Context, Poll};
pub async fn copy_out(
client: &InnerClient,
statement: Statement,
) -> Result<CopyOutStream, Error> {
pub async fn copy_out(client: &InnerClient, statement: Statement) -> Result<CopyOutStream, Error> {
let buf = query::encode(client, &statement, slice_iter(&[]))?;
let responses = start(client, buf).await?;
Ok(CopyOutStream {

View File

@ -221,10 +221,7 @@ impl<'a> Transaction<'a> {
}
/// Like `Client::copy_in`.
pub async fn copy_in<T, U>(
&self,
statement: &T,
) -> Result<CopyInSink<U>, Error>
pub async fn copy_in<T, U>(&self, statement: &T) -> Result<CopyInSink<U>, Error>
where
T: ?Sized + ToStatement,
U: Buf + 'static + Send,
@ -233,10 +230,7 @@ impl<'a> Transaction<'a> {
}
/// Like `Client::copy_out`.
pub async fn copy_out<T>(
&self,
statement: &T,
) -> Result<CopyOutStream, Error>
pub async fn copy_out<T>(&self, statement: &T) -> Result<CopyOutStream, Error>
where
T: ?Sized + ToStatement,
{