ReadOnlySequence<T> Struct
Definition
Represents a sequence that can read a sequential series of T
.
generic <typename T>
public value class ReadOnlySequence
public struct ReadOnlySequence<T>
type ReadOnlySequence<'T> = struct
Public Structure ReadOnlySequence(Of T)
Type Parameters
- T
The type of the elements in the read-only sequence.
- Inheritance
Constructors
ReadOnlySequence<T>(ReadOnlyMemory<T>) |
Creates an instance of ReadOnlySequence<T> from a ReadOnlyMemory<T>. |
ReadOnlySequence<T>(ReadOnlySequenceSegment<T>, Int32, ReadOnlySequenceSegment<T>, Int32) |
Creates an instance of a ReadOnlySequence<T> from a linked memory list represented by start and end segments and the corresponding indexes in them. |
ReadOnlySequence<T>(T[]) |
Creates an instance of ReadOnlySequence<T> from the |
ReadOnlySequence<T>(T[], Int32, Int32) |
Creates an instance of a ReadOnlySequence<T> from a section of an array. |
Fields
Empty |
Returns an empty ReadOnlySequence<T>. |
Properties
End |
Gets the position at the end of the ReadOnlySequence<T>. |
First |
Gets the ReadOnlyMemory<T> from the first segment. |
FirstSpan |
Gets the ReadOnlySpan<T> from the first segment. |
IsEmpty |
Gets a value that indicates whether the ReadOnlySequence<T> is empty. |
IsSingleSegment |
Gets a value that indicates whether the ReadOnlySequence<T> contains a single ReadOnlyMemory<T> segment. |
Length |
Gets the length of the ReadOnlySequence<T>. |
Start |
Gets the position to the start of the ReadOnlySequence<T>. |
Methods
GetEnumerator() |
Returns an enumerator over the ReadOnlySequence<T>. |
GetPosition(Int64) |
Returns a new SequencePosition at an |
GetPosition(Int64, SequencePosition) |
Returns a new SequencePosition starting at the specified offset from the |
Slice(Int32, Int32) |
Forms a slice out of the current ReadOnlySequence<T>, beginning at |
Slice(Int32, SequencePosition) |
Forms a slice out of the current ReadOnlySequence<T>, beginning at |
Slice(Int64) |
Forms a slice out of the current ReadOnlySequence<T>, beginning at a specified index and continuing to the end of the read-only sequence. |
Slice(Int64, Int64) |
Forms a slice out of the given ReadOnlySequence<T>, beginning at |
Slice(Int64, SequencePosition) |
Forms a slice out of the current ReadOnlySequence<T>, beginning at |
Slice(SequencePosition) |
Forms a slice out of the current ReadOnlySequence<T>, beginning at a specified sequence position and continuing to the end of the read-only sequence. |
Slice(SequencePosition, Int32) |
Forms a slice out of the current ReadOnlySequence<T>, beginning at |
Slice(SequencePosition, Int64) |
Forms a slice out of the current ReadOnlySequence<T>, beginning at |
Slice(SequencePosition, SequencePosition) |
Forms a slice out of the current ReadOnlySequence<T>, beginning at |
ToString() |
Returns a string that represents the current sequence. |
TryGet(SequencePosition, ReadOnlyMemory<T>, Boolean) |
Tries to retrieve the next segment after |
Extension Methods
CopyTo<T>(ReadOnlySequence<T>, Span<T>) |
Copies the ReadOnlySequence<T> to the specified Span<T>. |
PositionOf<T>(ReadOnlySequence<T>, T) |
Returns the position of the first occurrence of |
ToArray<T>(ReadOnlySequence<T>) |
Converts the ReadOnlySequence<T> to an array. |