Skip to content

Commit 975b6dc

Browse files
committed
PostgresConnectParams -> ConnectParams
1 parent 09cb2fd commit 975b6dc

3 files changed

Lines changed: 18 additions & 18 deletions

File tree

src/io.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::io::net::tcp;
44
use std::io::net::pipe;
55
use std::io::{Stream, IoResult};
66

7-
use {PostgresConnectParams,
7+
use {ConnectParams,
88
SslMode,
99
NoSsl,
1010
PreferSsl,
@@ -81,7 +81,7 @@ impl Writer for InternalStream {
8181
}
8282
}
8383

84-
fn open_socket(params: &PostgresConnectParams)
84+
fn open_socket(params: &ConnectParams)
8585
-> Result<InternalStream, PostgresConnectError> {
8686
let port = params.port.unwrap_or(DEFAULT_PORT);
8787
let socket = match params.target {
@@ -96,7 +96,7 @@ fn open_socket(params: &PostgresConnectParams)
9696
socket.map_err(|e| SocketError(e))
9797
}
9898

99-
pub fn initialize_stream(params: &PostgresConnectParams, ssl: &SslMode)
99+
pub fn initialize_stream(params: &ConnectParams, ssl: &SslMode)
100100
-> Result<MaybeSslStream<InternalStream>, PostgresConnectError> {
101101
let mut socket = try!(open_socket(params));
102102

src/lib.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ pub struct UserInfo {
173173

174174
/// Information necessary to open a new connection to a Postgres server.
175175
#[deriving(Clone)]
176-
pub struct PostgresConnectParams {
176+
pub struct ConnectParams {
177177
/// The target server
178178
pub target: ConnectTarget,
179179
/// The target port.
@@ -192,20 +192,20 @@ pub struct PostgresConnectParams {
192192
}
193193

194194
/// A trait implemented by types that can be converted into a
195-
/// `PostgresConnectParams`.
195+
/// `ConnectParams`.
196196
pub trait IntoConnectParams {
197-
/// Converts the value of `self` into a `PostgresConnectParams`.
198-
fn into_connect_params(self) -> result::Result<PostgresConnectParams, PostgresConnectError>;
197+
/// Converts the value of `self` into a `ConnectParams`.
198+
fn into_connect_params(self) -> result::Result<ConnectParams, PostgresConnectError>;
199199
}
200200

201-
impl IntoConnectParams for PostgresConnectParams {
202-
fn into_connect_params(self) -> result::Result<PostgresConnectParams, PostgresConnectError> {
201+
impl IntoConnectParams for ConnectParams {
202+
fn into_connect_params(self) -> result::Result<ConnectParams, PostgresConnectError> {
203203
Ok(self)
204204
}
205205
}
206206

207207
impl<'a> IntoConnectParams for &'a str {
208-
fn into_connect_params(self) -> result::Result<PostgresConnectParams, PostgresConnectError> {
208+
fn into_connect_params(self) -> result::Result<ConnectParams, PostgresConnectError> {
209209
match Url::parse(self) {
210210
Ok(url) => url.into_connect_params(),
211211
Err(err) => return Err(InvalidUrl(err)),
@@ -214,7 +214,7 @@ impl<'a> IntoConnectParams for &'a str {
214214
}
215215

216216
impl IntoConnectParams for Url {
217-
fn into_connect_params(self) -> result::Result<PostgresConnectParams, PostgresConnectError> {
217+
fn into_connect_params(self) -> result::Result<ConnectParams, PostgresConnectError> {
218218
let Url {
219219
host,
220220
port,
@@ -243,7 +243,7 @@ impl IntoConnectParams for Url {
243243
None
244244
};
245245

246-
Ok(PostgresConnectParams {
246+
Ok(ConnectParams {
247247
target: target,
248248
port: port,
249249
user: user,
@@ -374,7 +374,7 @@ impl InnerPostgresConnection {
374374
let params = try!(params.into_connect_params());
375375
let stream = try!(io::initialize_stream(&params, ssl));
376376

377-
let PostgresConnectParams {
377+
let ConnectParams {
378378
user,
379379
database,
380380
mut options,
@@ -723,7 +723,7 @@ impl PostgresConnection {
723723
/// To connect to the server via Unix sockets, `host` should be set to the
724724
/// absolute path of the directory containing the socket file. Since `/` is
725725
/// a reserved character in URLs, the path should be URL encoded. If the
726-
/// path contains non-UTF 8 characters, a `PostgresConnectParams` struct
726+
/// path contains non-UTF 8 characters, a `ConnectParams` struct
727727
/// should be created manually and passed in. Note that Postgres does not
728728
/// support SSL over Unix sockets.
729729
///
@@ -746,10 +746,10 @@ impl PostgresConnection {
746746
/// ```
747747
///
748748
/// ```rust,no_run
749-
/// # use postgres::{PostgresConnection, UserInfo, PostgresConnectParams, NoSsl, TargetUnix};
749+
/// # use postgres::{PostgresConnection, UserInfo, ConnectParams, NoSsl, TargetUnix};
750750
/// # let _ = || {
751751
/// # let some_crazy_path = Path::new("");
752-
/// let params = PostgresConnectParams {
752+
/// let params = ConnectParams {
753753
/// target: TargetUnix(some_crazy_path),
754754
/// port: None,
755755
/// user: Some(UserInfo {

src/pool.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
use std::sync::{Arc, Mutex};
66

7-
use {PostgresConnectParams, IntoConnectParams, PostgresConnection, SslMode};
7+
use {ConnectParams, IntoConnectParams, PostgresConnection, SslMode};
88
use error::PostgresConnectError;
99

1010
struct InnerConnectionPool {
11-
params: PostgresConnectParams,
11+
params: ConnectParams,
1212
ssl: SslMode,
1313
pool: Vec<PostgresConnection>,
1414
}

0 commit comments

Comments
 (0)