pub struct NotificationStream { /* private fields */ }Expand description
A live subscription to a PostgreSQL notification channel.
Obtained from PgConnection::listen. Drive the stream by calling
recv_timeout in a loop. Call unlisten when done to deregister the
channel on the server.
Implementations§
Source§impl NotificationStream
impl NotificationStream
Sourcepub async fn recv_timeout(
&mut self,
timeout: Duration,
) -> Option<PgNotification>
pub async fn recv_timeout( &mut self, timeout: Duration, ) -> Option<PgNotification>
Wait up to timeout for the next notification on this channel.
Returns Some(notification) if a matching notification arrives within
the timeout, or None if the timeout elapses. Notifications for
other channels are silently discarded.
Auto Trait Implementations§
impl !RefUnwindSafe for NotificationStream
impl !UnwindSafe for NotificationStream
impl Freeze for NotificationStream
impl Send for NotificationStream
impl Sync for NotificationStream
impl Unpin for NotificationStream
impl UnsafeUnpin for NotificationStream
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more