pub struct Node<T: ?Sized> where
    T: Types
{ /* private fields */ }
Expand description

A node in a PinList.

This type is a state machine between three states:

  1. Initial: The initial state; the node is not registered in any list. This is the only state that can be dropped without aborting the process.
  2. Linked: The node has been linked into a PinList. It holds a Protected and an Unprotected, of which the former can only be accessed when access to the PinList can be proven. Dropping a node in this state will abort.
  3. Removed: The node has been removed from a PinList. It holds a Removed and an Unprotected. Similar to the “linked” state, proof of access to the PinList is required for most operations. Dropping a node in this state will abort.

Implementations

Create a new node in its initial state.

You can move this node into other states by functions like PinList::push_front.

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

Executes the destructor for this type. Read more

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.