<PackageReference Include="System.Linq.AsyncEnumerable" Version="11.0.0" />

System.Linq.SingleLinkedNode<TSource>

sealed class SingleLinkedNode<TSource>
An immutable node in a singly-linked list of items.
public TSource Item { get; }

The item held by this node.

public SingleLinkedNode<TSource> Linked { get; }

The next node in the singly-linked list.

public SingleLinkedNode(TSource item)

Constructs a tail node.

public SingleLinkedNode<TSource> Add(TSource item)

Creates a new node that holds the specified item and is linked to this node.

public void Fill(Span<TSource> span)

Fills a start of a span with the items of this node's singly-linked list.

public void FillReversed(Span<TSource> span)

Fills the end of a span with the items of this node's singly-linked list in reverse.

public int GetCount()

Gets the number of items in this and subsequent nodes by walking the linked list.

public SingleLinkedNode<TSource> GetNode(int index)

Gets the node at a logical index by walking the linked list.

public TSource[] ToArray(int count)

Returns an array that contains the items of this node's singly-linked list in reverse.