diff --git a/postgres/src/config.rs b/postgres/src/config.rs index de14a2d3..7979f0d1 100644 --- a/postgres/src/config.rs +++ b/postgres/src/config.rs @@ -4,8 +4,9 @@ use log::error; use std::path::Path; use std::str::FromStr; use std::time::Duration; +use tokio_postgres::config::{SslMode, TargetSessionAttrs}; use tokio_postgres::tls::{MakeTlsConnect, TlsConnect}; -use tokio_postgres::{Error, Socket, SslMode, TargetSessionAttrs}; +use tokio_postgres::{Error, Socket}; use crate::{Client, RUNTIME}; diff --git a/tokio-postgres/src/config.rs b/tokio-postgres/src/config.rs index e3504065..76899725 100644 --- a/tokio-postgres/src/config.rs +++ b/tokio-postgres/src/config.rs @@ -1,3 +1,5 @@ +//! Connection configuration. + use std::borrow::Cow; use std::error; #[cfg(unix)] diff --git a/tokio-postgres/src/lib.rs b/tokio-postgres/src/lib.rs index 3c655cb0..b4dd6244 100644 --- a/tokio-postgres/src/lib.rs +++ b/tokio-postgres/src/lib.rs @@ -109,10 +109,10 @@ use std::error::Error as StdError; use std::sync::atomic::{AtomicUsize, Ordering}; use tokio_io::{AsyncRead, AsyncWrite}; -pub use crate::config::*; +pub use crate::config::Config; use crate::error::DbError; pub use crate::error::Error; -pub use crate::row::*; +pub use crate::row::{Row, SimpleQueryRow}; #[cfg(feature = "runtime")] pub use crate::socket::Socket; pub use crate::stmt::Column; @@ -122,11 +122,11 @@ pub use crate::tls::NoTls; use crate::tls::TlsConnect; use crate::types::{ToSql, Type}; -mod config; +pub mod config; pub mod error; pub mod impls; mod proto; -mod row; +pub mod row; #[cfg(feature = "runtime")] mod socket; mod stmt; diff --git a/tokio-postgres/src/proto/cancel_query.rs b/tokio-postgres/src/proto/cancel_query.rs index 1a7377c2..909fe654 100644 --- a/tokio-postgres/src/proto/cancel_query.rs +++ b/tokio-postgres/src/proto/cancel_query.rs @@ -2,8 +2,9 @@ use futures::{try_ready, Future, Poll}; use state_machine_future::{transition, RentToOwn, StateMachineFuture}; use std::io; +use crate::config::{Host, SslMode}; use crate::proto::{CancelQueryRawFuture, ConnectSocketFuture}; -use crate::{Config, Error, Host, MakeTlsConnect, Socket, SslMode}; +use crate::{Config, Error, MakeTlsConnect, Socket}; #[derive(StateMachineFuture)] pub enum CancelQuery diff --git a/tokio-postgres/src/proto/cancel_query_raw.rs b/tokio-postgres/src/proto/cancel_query_raw.rs index 522fe318..3580b358 100644 --- a/tokio-postgres/src/proto/cancel_query_raw.rs +++ b/tokio-postgres/src/proto/cancel_query_raw.rs @@ -4,9 +4,10 @@ use state_machine_future::{transition, RentToOwn, StateMachineFuture}; use tokio_io::io::{self, Flush, WriteAll}; use tokio_io::{AsyncRead, AsyncWrite}; +use crate::config::SslMode; use crate::error::Error; use crate::proto::{MaybeTlsStream, TlsFuture}; -use crate::{SslMode, TlsConnect}; +use crate::TlsConnect; #[derive(StateMachineFuture)] pub enum CancelQueryRaw diff --git a/tokio-postgres/src/proto/connect.rs b/tokio-postgres/src/proto/connect.rs index 1bc3f481..510c96be 100644 --- a/tokio-postgres/src/proto/connect.rs +++ b/tokio-postgres/src/proto/connect.rs @@ -1,8 +1,9 @@ use futures::{Async, Future, Poll}; use state_machine_future::{transition, RentToOwn, StateMachineFuture}; +use crate::config::Host; use crate::proto::{Client, ConnectOnceFuture, Connection, MaybeTlsStream}; -use crate::{Config, Error, Host, MakeTlsConnect, Socket}; +use crate::{Config, Error, MakeTlsConnect, Socket}; #[derive(StateMachineFuture)] pub enum Connect diff --git a/tokio-postgres/src/proto/connect_once.rs b/tokio-postgres/src/proto/connect_once.rs index f80ead1b..c42ebb1d 100644 --- a/tokio-postgres/src/proto/connect_once.rs +++ b/tokio-postgres/src/proto/connect_once.rs @@ -4,10 +4,11 @@ use futures::{try_ready, Async, Future, Poll, Stream}; use state_machine_future::{transition, RentToOwn, StateMachineFuture}; use std::io; +use crate::config::TargetSessionAttrs; use crate::proto::{ Client, ConnectRawFuture, ConnectSocketFuture, Connection, MaybeTlsStream, SimpleQueryStream, }; -use crate::{Config, Error, SimpleQueryMessage, Socket, TargetSessionAttrs, TlsConnect}; +use crate::{Config, Error, SimpleQueryMessage, Socket, TlsConnect}; #[derive(StateMachineFuture)] pub enum ConnectOnce diff --git a/tokio-postgres/src/proto/connect_socket.rs b/tokio-postgres/src/proto/connect_socket.rs index 7b7e5cb8..7b1f9205 100644 --- a/tokio-postgres/src/proto/connect_socket.rs +++ b/tokio-postgres/src/proto/connect_socket.rs @@ -11,7 +11,8 @@ use tokio_timer::Delay; #[cfg(unix)] use tokio_uds::UnixStream; -use crate::{Config, Error, Host, Socket}; +use crate::config::Host; +use crate::{Config, Error, Socket}; lazy_static! { static ref DNS_POOL: CpuPool = futures_cpupool::Builder::new() diff --git a/tokio-postgres/src/proto/tls.rs b/tokio-postgres/src/proto/tls.rs index 0f9d5376..00df2ed1 100644 --- a/tokio-postgres/src/proto/tls.rs +++ b/tokio-postgres/src/proto/tls.rs @@ -4,10 +4,11 @@ use state_machine_future::{transition, RentToOwn, StateMachineFuture}; use tokio_io::io::{self, ReadExact, WriteAll}; use tokio_io::{AsyncRead, AsyncWrite}; +use crate::config::SslMode; use crate::proto::MaybeTlsStream; use crate::tls::private::ForcePrivateApi; use crate::tls::ChannelBinding; -use crate::{Error, SslMode, TlsConnect}; +use crate::{Error, TlsConnect}; #[derive(StateMachineFuture)] pub enum Tls diff --git a/tokio-postgres/src/row.rs b/tokio-postgres/src/row.rs index 43b872d5..0dd4c052 100644 --- a/tokio-postgres/src/row.rs +++ b/tokio-postgres/src/row.rs @@ -1,3 +1,5 @@ +//! Rows. + use fallible_iterator::FallibleIterator; use postgres_protocol::message::backend::DataRowBody; use std::fmt;