ReadOnlySequence<T> ReadOnlySequence<T> ReadOnlySequence<T> ReadOnlySequence<T> Struct

定義

代表可讀取 T 循序序列的序列。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)

類型參數

T
繼承
ReadOnlySequence<T>ReadOnlySequence<T>ReadOnlySequence<T>ReadOnlySequence<T>

建構函式

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

ReadOnlyMemory<T> 建立 ReadOnlySequence<T> 的執行個體。Creates an instance of ReadOnlySequence<T> from a ReadOnlyMemory<T>.

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

array 建立 ReadOnlySequence<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)

從陣列區段建立 ReadOnlySequence<T> 的執行個體。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)

從開始和結束區段及其中對應索引所表示的連結記憶體清單,建立 ReadOnlySequence<T> 的執行個體。Creates an instance of a ReadOnlySequence<T> from a linked memory list represented by start and end segments and the corresponding indexes in them.

欄位

Empty Empty Empty Empty

傳回空的 ReadOnlySequence<T>Returns an empty ReadOnlySequence<T>

屬性

End End End End

取得 ReadOnlySequence<T> 結尾的位置。Gets the position at the end of the ReadOnlySequence<T>.

First First First First

從第一個區段取得 ReadOnlyMemory<T>Gets the ReadOnlyMemory<T> from the first segment.

FirstSpan FirstSpan FirstSpan FirstSpan

從第一個區段取得 ReadOnlySpan<T>Gets the ReadOnlySpan<T> from the first segment.

IsEmpty IsEmpty IsEmpty IsEmpty

取得值,這個值指出 ReadOnlySequence<T> 是否是空的。Gets a value that indicates whether the ReadOnlySequence<T> is empty.

IsSingleSegment IsSingleSegment IsSingleSegment IsSingleSegment

取得值,指出 ReadOnlySequence<T> 是否包含單一 ReadOnlyMemory<T> 區段。Gets a value that indicates whether the ReadOnlySequence<T> contains a single ReadOnlyMemory<T> segment.

Length Length Length Length

取得 ReadOnlySequence<T> 的長度。Gets the length of the ReadOnlySequence<T>.

Start Start Start Start

取得 ReadOnlySequence<T> 開頭的位置。Gets the position to the start of the ReadOnlySequence<T>.

方法

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

透過 ReadOnlySequence<T> 傳回列舉值。Returns an enumerator over the ReadOnlySequence<T>.

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

從序列開頭傳回 offset 的新 SequencePositionReturns a new SequencePosition at an offset from the start of the sequence.

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

origin 傳回 offset 的新 SequencePositionReturns a new SequencePosition at an offset from the origin.

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

從目前的 ReadOnlySequence<T> (從指定的索引開始,一直到唯讀序列的結尾) 形成配量。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)

從目前的 ReadOnlySequence<T> (從指定的序列位置開始,一直到唯讀序列的結尾) 形成配量。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)

從目前的 ReadOnlySequence<T> (從 start 開始,包含 length 個項目) 形成配量。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)

從目前的 ReadOnlySequence<T> (從 start 開始,到 end (不含) 結束) 形成配量。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)

從給定的 ReadOnlySequence<T> 形成配量 (從 start 開始,包含 length 個項目)。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)

從目前的 ReadOnlySequence<T> (從 start 開始,到 end (不含) 結束) 形成配量。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)

從目前的 ReadOnlySequence<T> (從 start 開始,包含 length 個項目) 形成配量。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)

從目前的 ReadOnlySequence<T> (從 start 開始,包含 length 個項目) 形成配量。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)

從目前的 ReadOnlySequence<T> (從 start 開始,到 end (不含) 結束) 形成配量。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)

嘗試擷取 position 之後的下一個區段,並傳回指出作業是否成功的值。Tries to retrieve the next segment after position and returns a value that indicates whether the operation succeeded.

擴充方法

CopyTo<T>(ReadOnlySequence<T>, Span<T>) CopyTo<T>(ReadOnlySequence<T>, Span<T>) CopyTo<T>(ReadOnlySequence<T>, Span<T>) CopyTo<T>(ReadOnlySequence<T>, Span<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)

傳回 ReadOnlySequence<T> 中出現第一個 item 的位置。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>)

ReadOnlySequence<T> 轉換成陣列。Converts the ReadOnlySequence<T> to an array.

適用於