Struct tokio::util::linked_list::PointersInner

source ·
struct PointersInner<T> {
    prev: Option<NonNull<T>>,
    next: Option<NonNull<T>>,
    _pin: PhantomPinned,
}
Expand description

We do not want the compiler to put the noalias attribute on mutable references to this type, so the type has been made !Unpin with a PhantomPinned field.

Additionally, we never access the prev or next fields directly, as any such access would implicitly involve the creation of a reference to the field, which we want to avoid since the fields are not !Unpin, and would hence be given the noalias attribute if we were to do such an access. As an alternative to accessing the fields directly, the Pointers type provides getters and setters for the two fields, and those are implemented using ptr-specific methods which avoids the creation of intermediate references.

See this link for more information: https://github.com/rust-lang/rust/pull/82834

Fields§

§prev: Option<NonNull<T>>

The previous node in the list. null if there is no previous node.

§next: Option<NonNull<T>>

The next node in the list. null if there is no previous node.

§_pin: PhantomPinned

This type is !Unpin due to the heuristic from: https://github.com/rust-lang/rust/pull/82834

Auto Trait Implementations§

§

impl<T> Freeze for PointersInner<T>

§

impl<T> RefUnwindSafe for PointersInner<T>
where T: RefUnwindSafe,

§

impl<T> !Send for PointersInner<T>

§

impl<T> !Sync for PointersInner<T>

§

impl<T> !Unpin for PointersInner<T>

§

impl<T> UnwindSafe for PointersInner<T>
where T: RefUnwindSafe,

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