ReadOnlySequence<T> ReadOnlySequence<T> ReadOnlySequence<T> 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
Inheritance
ReadOnlySequence<T>ReadOnlySequence<T>ReadOnlySequence<T>ReadOnlySequence<T>

Constructors

ReadOnlySequence<T>(ReadOnlyMemory<T>) ReadOnlySequence<T>(ReadOnlyMemory<T>) ReadOnlySequence<T>(ReadOnlyMemory<T>) ReadOnlySequence<T>(ReadOnlyMemory<T>)

Creates an instance of ReadOnlySequence<T> from a ReadOnlyMemory<T>.

ReadOnlySequence<T>(T[]) ReadOnlySequence<T>(T[]) ReadOnlySequence<T>(T[]) ReadOnlySequence<T>(T[])

Creates an instance of ReadOnlySequence<T> from the array.

ReadOnlySequence<T>(T[], Int32, Int32) ReadOnlySequence<T>(T[], Int32, Int32) ReadOnlySequence<T>(T[], Int32, Int32) ReadOnlySequence<T>(T[], Int32, Int32)

Creates an instance of a ReadOnlySequence<T> from a section of an array.

ReadOnlySequence<T>(ReadOnlySequenceSegment<T>, Int32, ReadOnlySequenceSegment<T>, Int32) ReadOnlySequence<T>(ReadOnlySequenceSegment<T>, Int32, ReadOnlySequenceSegment<T>, Int32) ReadOnlySequence<T>(ReadOnlySequenceSegment<T>, Int32, ReadOnlySequenceSegment<T>, Int32) 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.

Fields

Empty Empty Empty Empty

Returns an empty ReadOnlySequence<T>

Properties

End End End End

Gets the position at the end of the ReadOnlySequence<T>.

First First First First

Gets the ReadOnlyMemory<T> from the first segment.

FirstSpan FirstSpan FirstSpan FirstSpan

Gets the ReadOnlySpan<T> from the first segment.

IsEmpty IsEmpty IsEmpty IsEmpty

Gets a value that indicates whether the ReadOnlySequence<T> is empty.

IsSingleSegment IsSingleSegment IsSingleSegment IsSingleSegment

Gets a value that indicates whether the ReadOnlySequence<T> contains a single ReadOnlyMemory<T> segment.

Length Length Length Length

Gets the length of the ReadOnlySequence<T>.

Start Start Start Start

Gets the position to the start of the ReadOnlySequence<T>.

Methods

GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

Returns an enumerator over the ReadOnlySequence<T>.

GetPosition(Int64) GetPosition(Int64) GetPosition(Int64) GetPosition(Int64)

Returns a new SequencePosition at an offset from the start of the sequence.

GetPosition(Int64, SequencePosition) GetPosition(Int64, SequencePosition) GetPosition(Int64, SequencePosition) GetPosition(Int64, SequencePosition)

Returns a new SequencePosition at an offset from the origin.

Slice(Int64) Slice(Int64) Slice(Int64) 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(SequencePosition) Slice(SequencePosition) Slice(SequencePosition) 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(Int32, Int32) Slice(Int32, Int32) Slice(Int32, Int32) Slice(Int32, Int32)

Forms a slice out of the current ReadOnlySequence<T>, beginning at start, with length items.

Slice(Int32, SequencePosition) Slice(Int32, SequencePosition) Slice(Int32, SequencePosition) Slice(Int32, SequencePosition)

Forms a slice out of the current ReadOnlySequence<T>, beginning at start and ending at end (exclusive).

Slice(Int64, Int64) Slice(Int64, Int64) Slice(Int64, Int64) Slice(Int64, Int64)

Forms a slice out of the given ReadOnlySequence<T>, beginning at start, with length items.

Slice(Int64, SequencePosition) Slice(Int64, SequencePosition) Slice(Int64, SequencePosition) Slice(Int64, SequencePosition)

Forms a slice out of the current ReadOnlySequence<T>, beginning at start and ending at end (exclusive).

Slice(SequencePosition, Int32) Slice(SequencePosition, Int32) Slice(SequencePosition, Int32) Slice(SequencePosition, Int32)

Forms a slice out of the current ReadOnlySequence<T>, beginning at start, with length items.

Slice(SequencePosition, Int64) Slice(SequencePosition, Int64) Slice(SequencePosition, Int64) Slice(SequencePosition, Int64)

Forms a slice out of the current ReadOnlySequence<T>, beginning at start, with length items.

Slice(SequencePosition, SequencePosition) Slice(SequencePosition, SequencePosition) Slice(SequencePosition, SequencePosition) Slice(SequencePosition, SequencePosition)

Forms a slice out of the current ReadOnlySequence<T>, beginning at start and ending at end (exclusive).

ToString() ToString() ToString() ToString()
TryGet(SequencePosition, ReadOnlyMemory<T>, Boolean) TryGet(SequencePosition, ReadOnlyMemory<T>, Boolean) TryGet(SequencePosition, ReadOnlyMemory<T>, Boolean) TryGet(SequencePosition, ReadOnlyMemory<T>, Boolean)

Tries to retrieve the next segment after position and returns a value that indicates whether the operation succeeded.

Extension Methods

CopyTo<T>(ReadOnlySequence<T>, Span<T>) CopyTo<T>(ReadOnlySequence<T>, Span<T>) CopyTo<T>(ReadOnlySequence<T>, Span<T>) CopyTo<T>(ReadOnlySequence<T>, Span<T>)

Copies the ReadOnlySequence<T> to the specified Span<T>.

PositionOf<T>(ReadOnlySequence<T>, T) PositionOf<T>(ReadOnlySequence<T>, T) PositionOf<T>(ReadOnlySequence<T>, T) PositionOf<T>(ReadOnlySequence<T>, T)

Returns the position of the first occurrence of item in the ReadOnlySequence<T>.

ToArray<T>(ReadOnlySequence<T>) ToArray<T>(ReadOnlySequence<T>) ToArray<T>(ReadOnlySequence<T>) ToArray<T>(ReadOnlySequence<T>)

Converts the ReadOnlySequence<T> to an array.

Applies to