#[repr(transparent)]
pub struct InitializedNode<'node, T: ?Sized + Types> { /* private fields */ }
Expand description

A Node which is guaranteed to be initialized, accessed by Node::initialized and Node::initialized_mut.

You can never create and will never interact with owned or &mut instances of this type — it is accessed solely as &InitializedNode<'_, T> or Pin<&mut InitializedNode<'_, T>>.

Implementations

Get a shared reference to the unprotected data of this node.

Get a shared reference to the protected data of this node.

Returns None if the node is in its removed state (has been removed from the list).

Panics

Panics if the given list is a different one than this node was registered with.

Get a unique reference to the protected data of this node.

Returns None if the node is in its removed state (has been removed from the list).

Panics

Panics if the given list is a different one than this node was registered with.

Obtain a shared cursor pointing to this node.

Returns None if the node was in its removed state (it was removed from the list).

Panics

Panics if the given list is a different one than this node was registered with.

Obtain a unique cursor pointing to this node.

Returns None if the node was in its removed state (it was removed from the list).

Panics

Panics if the given list is a different one than this node was registered with.

Remove this node from its containing list and take its data, leaving the node in its initial state.

Errors

Fails if the node is in its removed state — use take_removed to handle that case, or call reset instead.

Panics

Panics if the given list is a different one than this node was registered with.

Take the data out of this node if it has been removed from the list, leaving the node in its initial state.

Errors

Errors if the node was in its “linked” state (it was still part of the list) — use unlink in this case, or call reset instead.

Panics

Panics if the given list is a different one than this node was registered with.

Take the data out of this node, assuming that it has been removed from the list, leaving the node in its initial state.

In contrast to take_removed, this does not require access to the PinList.

Safety

The node must not be in its linked state.

Reset the node back to its initial state.

If the node is linked, this will unlink it, and then the node will be moved to the initial state.

This can be thought of as a combination of unlink and take_removed.

Panics

Panics if the given list is a different one than this node was registered with.

Methods from Deref<Target = Node<T>>

Check whether the node is in its initial state.

Insert this node into the linked list before the given cursor.

Panics

Panics if the node is not in its initial state.

Insert this node into the linked list after the given cursor.

Panics

Panics if the node is not in its initial state.

Borrow the node, if it is initialized (linked or removed).

Returns None if the node is in the initial state.

Borrow uniquely the node, if it is initialized (linked or removed).

Returns None if the node is in the initial state.

Trait Implementations

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.