Rename notification iterator
This commit is contained in:
parent
3cd47fa559
commit
dbb698b9f3
11
src/lib.rs
11
src/lib.rs
@ -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()
|
||||
}
|
||||
|
||||
|
@ -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()
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user