pub struct NotificationQueue { /* private fields */ }Expand description
An unbounded queue that helps with simulation of registering event sources with Poll.
It keeps track of NotificationIds associated with Waker
Implementations§
Source§impl NotificationQueue
impl NotificationQueue
Sourcepub fn new(waker: Arc<Waker>) -> NotificationQueue
pub fn new(waker: Arc<Waker>) -> NotificationQueue
Creates a notification queue
Sourcepub fn push(&self, id: NotificationId) -> Result<()>
pub fn push(&self, id: NotificationId) -> Result<()>
Queues the NotificationId and notifies the Poll associated with Waker
Sourcepub fn pop(&self) -> Option<NotificationId>
pub fn pop(&self) -> Option<NotificationId>
Attempts to remove an element from the queue If the queue is empty, None is returned.
Trait Implementations§
Source§impl Debug for NotificationQueue
impl Debug for NotificationQueue
Source§impl Notifier for NotificationQueue
impl Notifier for NotificationQueue
Source§fn notify(&self, id: NotificationId) -> Result
fn notify(&self, id: NotificationId) -> Result
Notifies
PollAuto Trait Implementations§
impl !Freeze for NotificationQueue
impl RefUnwindSafe for NotificationQueue
impl Send for NotificationQueue
impl Sync for NotificationQueue
impl Unpin for NotificationQueue
impl UnwindSafe for NotificationQueue
Blanket Implementations§
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