@@ -230,11 +230,11 @@ impl PostgresNoticeHandler for DefaultNoticeHandler {
230
230
/// An asynchronous notification
231
231
pub struct PostgresNotification {
232
232
/// The process ID of the notifying backend process
233
- pid : i32 ,
233
+ pub pid : i32 ,
234
234
/// The name of the channel that the notify has been raised on
235
- channel : ~str ,
235
+ pub channel : ~str ,
236
236
/// The "payload" string passed from the notifying process
237
- payload : ~str ,
237
+ pub payload : ~str ,
238
238
}
239
239
240
240
/// An iterator over asynchronous notifications
@@ -257,9 +257,9 @@ impl<'conn> Iterator<PostgresNotification> for PostgresNotifications<'conn> {
257
257
/// Contains information necessary to cancel queries for a session
258
258
pub struct PostgresCancelData {
259
259
/// The process ID of the session
260
- process_id : i32 ,
260
+ pub process_id : i32 ,
261
261
/// The secret key for the session
262
- secret_key : i32 ,
262
+ pub secret_key : i32 ,
263
263
}
264
264
265
265
/// Attempts to cancel an in-progress query.
@@ -338,10 +338,10 @@ fn initialize_stream(host: &str, port: Port, ssl: &SslMode)
338
338
Err ( err) => return Err ( err)
339
339
} ;
340
340
341
- let ( ssl_required, ctx) = match ssl {
342
- & NoSsl => return Ok ( Normal ( socket) ) ,
343
- & PreferSsl ( ref ctx) => ( false , ctx) ,
344
- & RequireSsl ( ref ctx) => ( true , ctx)
341
+ let ( ssl_required, ctx) = match * ssl {
342
+ NoSsl => return Ok ( Normal ( socket) ) ,
343
+ PreferSsl ( ref ctx) => ( false , ctx) ,
344
+ RequireSsl ( ref ctx) => ( true , ctx)
345
345
} ;
346
346
347
347
try_pg_conn ! ( socket. write_message( & SslRequest { code: message:: SSL_CODE } ) ) ;
@@ -602,12 +602,12 @@ impl InnerPostgresConnection {
602
602
let mut result_desc: Vec < ResultDescription > = match try_pg ! ( self . read_message( ) ) {
603
603
RowDescription { descriptions } =>
604
604
descriptions. move_iter ( ) . map ( |desc| {
605
- let RowDescriptionEntry { name, type_oid, .. } = desc;
606
- ResultDescription {
607
- name : name,
608
- ty : PostgresType :: from_oid ( type_oid)
609
- }
610
- } ) . collect ( ) ,
605
+ let RowDescriptionEntry { name, type_oid, .. } = desc;
606
+ ResultDescription {
607
+ name : name,
608
+ ty : PostgresType :: from_oid ( type_oid)
609
+ }
610
+ } ) . collect ( ) ,
611
611
NoData => Vec :: new ( ) ,
612
612
_ => unreachable ! ( )
613
613
} ;
@@ -645,8 +645,8 @@ impl InnerPostgresConnection {
645
645
Some ( name) => return Ok ( name. clone ( ) ) ,
646
646
None => { }
647
647
}
648
- let name = try!( self . quick_query (
649
- format ! ( "SELECT typname FROM pg_type WHERE oid={}", oid) ) )
648
+ let name = try!( self . quick_query ( format ! ( "SELECT typname FROM pg_type \
649
+ WHERE oid={}", oid) ) )
650
650
. move_iter ( ) . next ( ) . unwrap ( ) . move_iter ( ) . next ( ) . unwrap ( ) . unwrap ( ) ;
651
651
self . unknown_types . insert ( oid, name. clone ( ) ) ;
652
652
Ok ( name)
@@ -721,8 +721,8 @@ impl PostgresConnection {
721
721
/// Err(err) => fail!("Error connecting: {}", err)
722
722
/// };
723
723
/// ```
724
- pub fn connect ( url : & str , ssl : & SslMode )
725
- -> Result < PostgresConnection , PostgresConnectError > {
724
+ pub fn connect ( url : & str , ssl : & SslMode ) -> Result < PostgresConnection ,
725
+ PostgresConnectError > {
726
726
InnerPostgresConnection :: connect ( url, ssl) . map ( |conn| {
727
727
PostgresConnection {
728
728
conn : RefCell :: new ( conn)
@@ -1293,6 +1293,7 @@ impl<'stmt> PostgresRows<'stmt> {
1293
1293
///
1294
1294
/// Functionally identical to the `Drop` implementation on `PostgresRows`
1295
1295
/// except that it returns any error to the caller.
1296
+ #[ inline]
1296
1297
pub fn finish ( mut self ) -> PostgresResult < ( ) > {
1297
1298
self . finished = true ;
1298
1299
self . finish_inner ( )
@@ -1316,11 +1317,13 @@ impl<'stmt> PostgresRows<'stmt> {
1316
1317
}
1317
1318
1318
1319
impl < ' stmt > Iterator < PostgresRow < ' stmt > > for PostgresRows < ' stmt > {
1320
+ #[ inline]
1319
1321
fn next ( & mut self ) -> Option < PostgresRow < ' stmt > > {
1320
1322
// we'll never hit the network on a non-lazy result
1321
1323
self . try_next ( ) . map ( |r| r. unwrap ( ) )
1322
1324
}
1323
1325
1326
+ #[ inline]
1324
1327
fn size_hint ( & self ) -> ( uint , Option < uint > ) {
1325
1328
let lower = self . data . len ( ) ;
1326
1329
let upper = if self . more_rows {
@@ -1443,17 +1446,20 @@ pub struct PostgresLazyRows<'trans, 'stmt> {
1443
1446
1444
1447
impl < ' trans , ' stmt > PostgresLazyRows < ' trans , ' stmt > {
1445
1448
/// Like `PostgresRows::finish`.
1449
+ #[ inline]
1446
1450
pub fn finish ( self ) -> PostgresResult < ( ) > {
1447
1451
self . result . finish ( )
1448
1452
}
1449
1453
}
1450
1454
1451
1455
impl < ' trans , ' stmt > Iterator < PostgresResult < PostgresRow < ' stmt > > >
1452
1456
for PostgresLazyRows < ' trans , ' stmt > {
1457
+ #[ inline]
1453
1458
fn next ( & mut self ) -> Option < PostgresResult < PostgresRow < ' stmt > > > {
1454
1459
self . result . try_next ( )
1455
1460
}
1456
1461
1462
+ #[ inline]
1457
1463
fn size_hint ( & self ) -> ( uint , Option < uint > ) {
1458
1464
self . result . size_hint ( )
1459
1465
}
0 commit comments