[−][src]Struct pagecache::Stack
A simple lock-free stack, with the ability to atomically append or entirely swap-out entries.
Methods
impl<T: Clone + Send + Sync + 'static> Stack<T>
[src]
pub fn push(&self, inner: T)
[src]
Add an item to the stack, spinning until successful.
pub fn cap<'g>(
&self,
old: Shared<Node<T>>,
new: T,
guard: &'g Guard
) -> Result<Shared<'g, Node<T>>, (Shared<'g, Node<T>>, Owned<Node<T>>)>
[src]
&self,
old: Shared<Node<T>>,
new: T,
guard: &'g Guard
) -> Result<Shared<'g, Node<T>>, (Shared<'g, Node<T>>, Owned<Node<T>>)>
compare and push
pub fn cap_node<'g>(
&self,
old: Shared<Node<T>>,
node: Owned<Node<T>>,
guard: &'g Guard
) -> Result<Shared<'g, Node<T>>, (Shared<'g, Node<T>>, Owned<Node<T>>)>
[src]
&self,
old: Shared<Node<T>>,
node: Owned<Node<T>>,
guard: &'g Guard
) -> Result<Shared<'g, Node<T>>, (Shared<'g, Node<T>>, Owned<Node<T>>)>
compare and push
pub fn cas<'g>(
&self,
old: Shared<'g, Node<T>>,
new: Owned<Node<T>>,
guard: &'g Guard
) -> Result<Shared<'g, Node<T>>, (Shared<'g, Node<T>>, Owned<Node<T>>)>
[src]
&self,
old: Shared<'g, Node<T>>,
new: Owned<Node<T>>,
guard: &'g Guard
) -> Result<Shared<'g, Node<T>>, (Shared<'g, Node<T>>, Owned<Node<T>>)>
compare and swap
pub fn head<'g>(&self, guard: &'g Guard) -> Shared<'g, 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> Drop for Stack<T>
[src]
impl<T: Send + 'static> Default for Stack<T>
[src]
impl<T> Debug for Stack<T> where
T: Clone + Debug + Send + 'static + Sync,
[src]
T: Clone + Debug + Send + 'static + Sync,
Auto Trait Implementations
impl<T> Unpin for Stack<T>
impl<T> Send for Stack<T> where
T: Sync,
T: Sync,
impl<T> Sync for Stack<T> where
T: Sync,
T: Sync,
impl<T> RefUnwindSafe for Stack<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> UnwindSafe for Stack<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,