Struct sled::Stack
[−]
[src]
pub struct Stack<T: Send + 'static> { /* fields omitted */ }
A simple lock-free stack, with the ability to atomically append or entirely swap-out entries.
Methods
impl<T: Send + 'static> Stack<T>
[src]
fn push(&self, inner: T)
[src]
Add an item to the stack, spinning until successful.
fn pop(&self) -> Option<T>
[src]
Pop the next item off the stack. Returns None if nothing is there.
fn cap<'s>(
&self,
old: Ptr<Node<T>>,
new: T,
scope: &'s Scope
) -> Result<Ptr<'s, Node<T>>, Ptr<'s, Node<T>>>
[src]
&self,
old: Ptr<Node<T>>,
new: T,
scope: &'s Scope
) -> Result<Ptr<'s, Node<T>>, Ptr<'s, Node<T>>>
compare and push
fn cas<'s>(
&self,
old: Ptr<'s, Node<T>>,
new: Ptr<'s, Node<T>>,
scope: &'s Scope
) -> Result<Ptr<'s, Node<T>>, Ptr<'s, Node<T>>>
[src]
&self,
old: Ptr<'s, Node<T>>,
new: Ptr<'s, Node<T>>,
scope: &'s Scope
) -> Result<Ptr<'s, Node<T>>, Ptr<'s, Node<T>>>
attempt consolidation
fn head<'s>(&self, scope: &'s Scope) -> Ptr<'s, Node<T>>
[src]
Returns the current head pointer of the stack, which can later be used as the key for cas and cap operations.
Trait Implementations
impl<T: Send + 'static> Default for Stack<T>
[src]
impl<T: Send + 'static> Drop for Stack<T>
[src]
impl<T> Debug for Stack<T> where
T: Debug + Send + 'static + Sync,
[src]
T: Debug + Send + 'static + Sync,