Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry[T any] interface { // Value() gets the value of the list entry. Value() T // Close() removes the entry from the list and returns the Entry to the // list's object pool. Referring to an Entry after its Close() method is // called is undefined behavior. Close() // Freshen removes the entry from the list, and re-adds it. This is // semantically equivalent to the following example implementation, except // that the Entry is not destroyed and can continue to be used: // // v := entry.Value() // entry.Close() // list.Append(v) Freshen() }
Entry represents an entry in a List.
type List ¶
type List[T any] interface { // Add an item to the list. Returns an [Entry] which can be used to remove // the item. Append(T) Entry[T] // Get the least recently added item from the list. Last() Entry[T] // Get the number of items in the list. Len() int }
List implements a doubly-linked list. It works as a FIFO, except that it allowd removing arbitrary items.
Click to show internal directories.
Click to hide internal directories.