Table of Contents

SpanList<T> Struct

public readonly struct SpanList<T> : IEquatable<SpanList<T>>

Type Parameters

T
Implements
Inherited Members
Extension Methods

Constructors

SpanList(T[]?, IEnumerable<IEnumerable<T>>?)
SpanList(T[]?, params IEnumerable<T>[]?)
SpanList(T[]?, int, ReadOnlySpan<T>, ReadOnlySpan<T>, ReadOnlySpan<T>, ReadOnlySpan<T>, ReadOnlySpan<T>, ReadOnlySpan<T>, ReadOnlySpan<T>, ReadOnlySpan<T>, ReadOnlySpan<T>, ReadOnlySpan<T>)

Properties

Count
this[int]

You can take non-readonly view by using GetSpanUnsafe(int, out Span<T>).

Ranges

Methods

Equals(SpanList<T>)

Indicates whether the current object is equal to another object of the same type.

Equals(object?)

Indicates whether this instance and a specified object are equal.

GetCapacity(int)

Get available capacity for span at the index.

GetFullRange(int)

Return full range for span at the index. It can be used to restore broken range on unsafe operation.

GetHashCode()

Returns the hash code for this instance.

GetSpanUnsafe(int, out Span<T>)

This method returns direct reference to internal array item. You can trim or extend range by editing that.

> [!WARNING] > You need to be familiar with C#'s `ref return` language feature.

// basic usage
spanList.GetSpanUnsafe(i, out var span).SetLength(WriteToBuffer(span, data));
> [!CAUTION] > `ref Range` modification will have never been validated by this library.
Write<TState>(int, TState, SpanWriter<TState>)

Operators

operator ==(SpanList<T>, SpanList<T>)
explicit operator SpanList<T>(IEnumerable<T>[]?)
operator !=(SpanList<T>, SpanList<T>)