Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
ReadOnlySequence<T> Struct
Definition
- Namespace:
- System.Buffers
- Assemblies:
- netstandard.dll, System.Memory.dll
- Assembly:
- System.Memory.dll
- Assembly:
- netstandard.dll
- Source:
- ReadOnlySequence.cs
- Source:
- ReadOnlySequence.cs
- Source:
- ReadOnlySequence.cs
- Source:
- ReadOnlySequence.cs
- Source:
- ReadOnlySequence.cs
Important
Some information relates to prerelease product that may be substantially modified before itβs released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a sequence that can read a sequential series of T.
generic <typename T>
public value class ReadOnlySequence
public readonly 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
| Name | Description |
|---|---|
| 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[], Int32, Int32) |
Creates an instance of a ReadOnlySequence<T> from a section of an array. |
| ReadOnlySequence<T>(T[]) |
Creates an instance of ReadOnlySequence<T> from the |
Fields
| Name | Description |
|---|---|
| Empty |
Returns an empty ReadOnlySequence<T>. |
Properties
| Name | Description |
|---|---|
| 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
| Name | Description |
|---|---|
| GetEnumerator() |
Returns an enumerator over the ReadOnlySequence<T>. |
| GetOffset(SequencePosition) |
Returns the offset of a |
| GetPosition(Int64, SequencePosition) |
Returns a new SequencePosition starting at the specified offset from the |
| GetPosition(Int64) |
Returns a new SequencePosition at an |
| 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, 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(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, 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 |
| 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. |
| ToString() |
Returns a string that represents the current sequence. |
| TryGet(SequencePosition, ReadOnlyMemory<T>, Boolean) |
Tries to retrieve the next segment after |
Extension Methods
| Name | Description |
|---|---|
| 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. |
Applies to
Feedback
Was this page helpful?
