scc

Struct LinkedEntry

Source
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>

Source

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> AsMut<T> for Entry<T>

Source§

fn as_mut(&mut self) -> &mut T

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl<T> AsRef<T> for Entry<T>

Source§

fn as_ref(&self) -> &T

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T: Clone> Clone for Entry<T>

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for Entry<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T> Deref for Entry<T>

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<T> DerefMut for Entry<T>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<T: Display> Display for Entry<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T> Drop for Entry<T>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<T> LinkedList for Entry<T>

Returns a reference to the forward link. Read more
Source§

fn is_clear(&self, order: Ordering) -> bool

Returns true if self is reachable and not marked. Read more
Source§

fn mark(&self, order: Ordering) -> bool

Marks self with an internal flag to denote that self is in a special state. Read more
Source§

fn unmark(&self, order: Ordering) -> bool

Removes any mark from self. Read more
Source§

fn is_marked(&self, order: Ordering) -> bool

Returns true if self has a mark on it. Read more
Source§

fn delete_self(&self, order: Ordering) -> bool

Deletes self. Read more
Source§

fn is_deleted(&self, order: Ordering) -> bool

Returns true if self has been deleted. Read more
Source§

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 more
Source§

fn next_ptr<'g>(&self, order: Ordering, guard: &'g Guard) -> Ptr<'g, Self>

Returns the closest next valid entry. Read more
Source§

fn next_shared(&self, order: Ordering, guard: &Guard) -> Option<Shared<Self>>

Returns a Shared handle to the closest next valid entry. Read more
Source§

impl<T: PartialEq> PartialEq for Entry<T>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compares self to key and returns true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.