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
|
/// An iterator over asynchronous notifications
|
||||||
pub struct PostgresNotificationIterator<'conn> {
|
pub struct PostgresNotifications<'conn> {
|
||||||
priv conn: &'conn PostgresConnection
|
priv conn: &'conn PostgresConnection
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'conn > Iterator<PostgresNotification> for
|
impl<'conn > Iterator<PostgresNotification> for PostgresNotifications<'conn> {
|
||||||
PostgresNotificationIterator<'conn> {
|
|
||||||
/// Returns the oldest pending notification or `None` if there are none.
|
/// Returns the oldest pending notification or `None` if there are none.
|
||||||
///
|
///
|
||||||
/// # Note
|
/// # Note
|
||||||
@ -649,8 +648,8 @@ impl PostgresConnection {
|
|||||||
/// Returns an iterator over asynchronous notification messages.
|
/// Returns an iterator over asynchronous notification messages.
|
||||||
///
|
///
|
||||||
/// Use the `LISTEN` command to register this connection for notifications.
|
/// Use the `LISTEN` command to register this connection for notifications.
|
||||||
pub fn notifications<'a>(&'a self) -> PostgresNotificationIterator<'a> {
|
pub fn notifications<'a>(&'a self) -> PostgresNotifications<'a> {
|
||||||
PostgresNotificationIterator {
|
PostgresNotifications {
|
||||||
conn: self
|
conn: self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -825,7 +824,7 @@ impl<'conn> PostgresTransaction<'conn> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Like `PostgresConnection::notifications`.
|
/// Like `PostgresConnection::notifications`.
|
||||||
pub fn notifications<'a>(&'a self) -> PostgresNotificationIterator<'a> {
|
pub fn notifications<'a>(&'a self) -> PostgresNotifications<'a> {
|
||||||
self.conn.notifications()
|
self.conn.notifications()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ extern mod extra;
|
|||||||
|
|
||||||
use extra::arc::MutexArc;
|
use extra::arc::MutexArc;
|
||||||
|
|
||||||
use super::{PostgresNotificationIterator,
|
use super::{PostgresNotifications,
|
||||||
PostgresCancelData,
|
PostgresCancelData,
|
||||||
PostgresConnection,
|
PostgresConnection,
|
||||||
NormalPostgresStatement,
|
NormalPostgresStatement,
|
||||||
@ -147,7 +147,7 @@ impl PooledPostgresConnection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Like `PostgresConnection::notifications`.
|
/// Like `PostgresConnection::notifications`.
|
||||||
pub fn notifications<'a>(&'a self) -> PostgresNotificationIterator<'a> {
|
pub fn notifications<'a>(&'a self) -> PostgresNotifications<'a> {
|
||||||
self.conn.get_ref().notifications()
|
self.conn.get_ref().notifications()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user