pub struct LinkedEntry<T> { /* private fields */ }
Expand description
Entry
stores an instance of T
and a link to the next entry.
Implementations§
Source§impl<T> Entry<T>
impl<T> Entry<T>
Sourcepub unsafe fn take_inner(&mut self) -> T
pub unsafe fn take_inner(&mut self) -> T
Extracts the inner instance of T
.
§Safety
This method has to be called at most once per Entry
, and the caller needs to make sure
that the Entry
is not accessed via LinkedList
methods.
§Examples
use scc::Stack;
let stack: Stack<usize> = Stack::default();
stack.push(37);
let mut entry = stack.pop().unwrap();
let pushed = unsafe { entry.get_mut().unwrap().take_inner() };
assert_eq!(pushed, 37);
Trait Implementations§
Source§impl<T> LinkedList for Entry<T>
impl<T> LinkedList for Entry<T>
Source§fn link_ref(&self) -> &AtomicShared<Self>
fn link_ref(&self) -> &AtomicShared<Self>
Returns a reference to the forward link. Read more
Source§fn is_deleted(&self, order: Ordering) -> bool
fn is_deleted(&self, order: Ordering) -> bool
Source§fn push_back<'g>(
&self,
entry: Shared<Self>,
mark: bool,
order: Ordering,
guard: &'g Guard,
) -> Result<Ptr<'g, Self>, Shared<Self>>
fn push_back<'g>( &self, entry: Shared<Self>, mark: bool, order: Ordering, guard: &'g Guard, ) -> Result<Ptr<'g, Self>, Shared<Self>>
Appends the given entry to
self
and returns a pointer to the entry. Read moreimpl<T: Eq> Eq for Entry<T>
Auto Trait Implementations§
impl<T> !Freeze for Entry<T>
impl<T> RefUnwindSafe for Entry<T>where
T: RefUnwindSafe,
impl<T> Send for Entry<T>where
T: Send,
impl<T> Sync for Entry<T>where
T: Sync,
impl<T> Unpin for Entry<T>where
T: Unpin,
impl<T> UnwindSafe for Entry<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compares
self
to key
and returns true
if they are equal.