IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: Nightly
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

Node

struct Node[ElementType: Copyable & ImplicitlyDestructible]

A node in a linked list data structure.

Parameters

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 & Writable)

Write this node's value to the given writer.

Args:

  • writer (T): The writer to write the value to.