Struct RentedMemorySequenceSegmentCollection<T>
A lightweight collection of RentedMemorySequence<T> or RentedMemorySequenceSpan<T> segment slices.
public readonly ref struct RentedMemorySequenceSegmentCollection<T>
Type Parameters
T
Element type.
- Inherited Members
Properties
Empty
An empty sequence segment collection.
public static RentedMemorySequenceSegmentCollection<T> Empty { get; }
Property Value
this[int]
Gets the full or partial segment at the specified position in this sequence segment collection.
public ArraySegment<T> this[int index] { get; }
Parameters
index
intThe zero-based index of the segment to get.
Property Value
- ArraySegment<T>
Exceptions
- ArgumentOutOfRangeException
When
index
is less than 0 or greater than or equal to Length.
Length
Total number of fully or partially occupied segments.
public int Length { get; }
Property Value
Methods
GetEnumerator()
Creates a new RentedMemorySequenceSegmentCollection<T>.Enumerator instance for this sequence segment collection.
[Pure]
public RentedMemorySequenceSegmentCollection<T>.Enumerator GetEnumerator()
Returns
- RentedMemorySequenceSegmentCollection<T>.Enumerator
New RentedMemorySequenceSegmentCollection<T>.Enumerator instance.
ToArray()
Creates a new Array instance from this sequence segment collection.
[Pure]
public ArraySegment<T>[] ToArray()
Returns
- ArraySegment<T>[]
New Array instance.
ToString()
Returns a string representation of this RentedMemorySequenceSegmentCollection<T> instance.
[Pure]
public override string ToString()
Returns
- string
String representation.