pub trait TQueueLike<T>: Clone + Send {
    // Required methods
    fn read(&self) -> StmResult<T>;
    fn write(&self, value: T) -> StmResult<()>;
    fn is_empty(&self) -> StmResult<bool>;
}
Expand description

Transactional queue-like structure.

This is a common interface between the various implementations in Simon Marlow’s book.

Required Methods§

source

fn read(&self) -> StmResult<T>

Pop the head of the queue, or retry until there is an element if it’s empty.

source

fn write(&self, value: T) -> StmResult<()>

Push to the end of the queue.

source

fn is_empty(&self) -> StmResult<bool>

Check if the queue is empty.

Implementors§

source§

impl<T> TQueueLike<T> for TBQueue<T>where T: Any + Sync + Send + Clone,

source§

impl<T> TQueueLike<T> for TChan<T>where T: Any + Sync + Send + Clone,

source§

impl<T> TQueueLike<T> for TQueue<T>where T: Any + Sync + Send + Clone,

source§

impl<T> TQueueLike<T> for TVecDequeue<T>where T: Any + Sync + Send + Clone,