[][src]Struct revenq::Queue

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

A simple event / revision queue

Fields

pending: VecDeque<T>

Implementations

impl<T: Send + 'static> Queue<T>[src]

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

Similiar to Queue::next_blocking, but async. Only returns None if no other reference to the queue exists anymore, thus, otherwise nothing could wake this up.

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

Similiar to next, but waits for an event on the WokeQueue, until at least one event (or event block) got ready. Only returns None if no other reference to the queue exists anymore, to prevent a deadlock, because nothing could wake this up.

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.

pub fn skip_and_publish(&mut self)[src]

Discards all newly published revisions and enforces publishing of our pending revisions.

impl<T> Queue<T>[src]

pub fn new() -> Self[src]

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: Send + 'static> 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

impl<T> Send for Queue<T> where
    T: Send + Sync

impl<T> Sync for Queue<T> where
    T: Send + Sync

impl<T> UnwindSafe for Queue<T> where
    T: UnwindSafe

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.