Struct crossbeam::sync::TreiberStack [−][src]
pub struct TreiberStack<T> { /* fields omitted */ }
Treiber's lock-free stack.
Usable with any number of producers and consumers.
Methods
impl<T> TreiberStack<T>
[src]
impl<T> TreiberStack<T>
pub fn new() -> TreiberStack<T>
[src]
pub fn new() -> TreiberStack<T>
Create a new, empty stack.
pub fn push(&self, t: T)
[src]
pub fn push(&self, t: T)
Push t
on top of the stack.
pub fn pop(&self) -> Option<T>
[src]
pub fn pop(&self) -> Option<T>
Attempt to pop the top element of the stack. Deprecated method, use try_pop
Returns None
if the stack is observed to be empty.
pub fn try_pop(&self) -> Option<T>
[src]
pub fn try_pop(&self) -> Option<T>
Attempt to pop the top element of the stack.
Returns None
if the stack is observed to be empty.
pub fn is_empty(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
Check if this queue is empty.
Trait Implementations
impl<T: Debug> Debug for TreiberStack<T>
[src]
impl<T: Debug> Debug for TreiberStack<T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T> Drop for TreiberStack<T>
[src]
impl<T> Drop for TreiberStack<T>
impl<T> Default for TreiberStack<T>
[src]
impl<T> Default for TreiberStack<T>
Auto Trait Implementations
impl<T> Send for TreiberStack<T> where
T: Sync,
impl<T> Send for TreiberStack<T> where
T: Sync,
impl<T> Sync for TreiberStack<T> where
T: Sync,
impl<T> Sync for TreiberStack<T> where
T: Sync,