Struct scc::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>

§

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§

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

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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> 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<T> ToOwned for T
where T: Clone,

§

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

§

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

§

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.