Rename notification iterator

This commit is contained in:
Steven Fackler 2014-02-03 00:09:48 -05:00
parent 3cd47fa559
commit dbb698b9f3
2 changed files with 7 additions and 8 deletions

View File

@ -174,12 +174,11 @@ pub struct PostgresNotification {
}
/// An iterator over asynchronous notifications
pub struct PostgresNotificationIterator<'conn> {
pub struct PostgresNotifications<'conn> {
priv conn: &'conn PostgresConnection
}
impl<'conn > Iterator<PostgresNotification> for
PostgresNotificationIterator<'conn> {
impl<'conn > Iterator<PostgresNotification> for PostgresNotifications<'conn> {
/// Returns the oldest pending notification or `None` if there are none.
///
/// # Note
@ -649,8 +648,8 @@ impl PostgresConnection {
/// Returns an iterator over asynchronous notification messages.
///
/// Use the `LISTEN` command to register this connection for notifications.
pub fn notifications<'a>(&'a self) -> PostgresNotificationIterator<'a> {
PostgresNotificationIterator {
pub fn notifications<'a>(&'a self) -> PostgresNotifications<'a> {
PostgresNotifications {
conn: self
}
}
@ -825,7 +824,7 @@ impl<'conn> PostgresTransaction<'conn> {
}
/// Like `PostgresConnection::notifications`.
pub fn notifications<'a>(&'a self) -> PostgresNotificationIterator<'a> {
pub fn notifications<'a>(&'a self) -> PostgresNotifications<'a> {
self.conn.notifications()
}

View File

@ -4,7 +4,7 @@ extern mod extra;
use extra::arc::MutexArc;
use super::{PostgresNotificationIterator,
use super::{PostgresNotifications,
PostgresCancelData,
PostgresConnection,
NormalPostgresStatement,
@ -147,7 +147,7 @@ impl PooledPostgresConnection {
}
/// Like `PostgresConnection::notifications`.
pub fn notifications<'a>(&'a self) -> PostgresNotificationIterator<'a> {
pub fn notifications<'a>(&'a self) -> PostgresNotifications<'a> {
self.conn.get_ref().notifications()
}