pub struct EventQueue<T> { /* private fields */ }Expand description
A queue of events. Clones push to and take from the same queue.
Implementations§
Source§impl<T> EventQueue<T>
impl<T> EventQueue<T>
pub fn new() -> Self
Sourcepub fn push(&self, event: T)
pub fn push(&self, event: T)
Adds event at the end of the queue. The waker runs when the queue
was empty, after the queue is unlocked.
Sourcepub fn take(&self) -> Vec<T>
pub fn take(&self) -> Vec<T>
Takes every event in the queue, oldest first. The queue keeps its buffer for the events pushed next.
Trait Implementations§
Source§impl<T> Clone for EventQueue<T>
impl<T> Clone for EventQueue<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for EventQueue<T>
impl<T> !UnwindSafe for EventQueue<T>
impl<T> Forget for EventQueue<T>
impl<T> Freeze for EventQueue<T>
impl<T> Move for EventQueue<T>
impl<T> Send for EventQueue<T>
impl<T> Sync for EventQueue<T>
impl<T> Unpin for EventQueue<T>
impl<T> UnsafeUnpin for EventQueue<T>where
Arc<Shared<T>>: UnsafeUnpin,
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