Node
struct Node[ElementType: Copyable & ImplicitlyDestructible]
A node in a linked list data structure.
Parameters
- ElementType (
Copyable&ImplicitlyDestructible): The type of element stored in the node.
Fields
- value (
ElementType): The value stored in this node.
Implemented traits
AnyType,
Copyable,
ImplicitlyDestructible,
Movable
Methods
__init__
__init__(out self, var value: ElementType, prev: Optional[Optional[UnsafePointer[NoneType, MutExternalOrigin]]], next: Optional[Optional[UnsafePointer[NoneType, MutExternalOrigin]]])
Initialize a new Node with the given value and optional prev/next pointers.
Args:
write_to
write_to(self, mut writer: T) where conforms_to(ElementType, AnyType & ImplicitlyDestructible & Writable)
Write this node's value to the given writer.
Args:
- writer (
T): The writer to write the value to.