[][src]Struct revenq::Queue

#[must_use =
  "Queue does nothing unless you call .next() or some variation of it"]pub struct Queue<T> {
    pub pending: Vec<T>,
    // some fields omitted
}

A simple event / revision queue

Fields

pending: Vec<T>

Implementations

impl<T> Queue<T>[src]

pub fn new() -> Self[src]

pub async fn next_async(&mut self) -> Option<RevisionRef<T>>[src]

Waits asynchronously for an event to be published on the queue. Only returns None if no other reference to the queue exists anymore, because otherwise nothing could wake this up. Tries to publish pending revisions while waiting.

pub fn enqueue(&mut self, pending: T)[src]

This method enqueues the pending revision for publishing. The iterator must be "collected"/"polled" (calling Iterator::next until it returns None) to publish them.

impl<T: Debug> Queue<T>[src]

pub fn print_debug<W: Write>(&self, writer: W, prefix: &str) -> Result<()>[src]

Helper function, prints all unprocessed, newly published revisions

Trait Implementations

impl<T> Clone for Queue<T>[src]

impl<T: Debug> Debug for Queue<T>[src]

impl<T> Default for Queue<T>[src]

impl<T> Drop for Queue<T>[src]

impl<T> Iterator for Queue<T>[src]

type Item = RevisionRef<T>

The type of the elements being iterated over.

impl<T: Unpin> Unpin for Queue<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Queue<T> where
    T: RefUnwindSafe + UnwindSafe
[src]

impl<T> Send for Queue<T> where
    T: Send + Sync
[src]

impl<T> Sync for Queue<T> where
    T: Send + Sync
[src]

impl<T> UnwindSafe for Queue<T> where
    T: RefUnwindSafe + UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.