ReadOnlyMemory<T> 構造体
定義
ReadOnlySpan<T> と似ていますが、メモリの隣接した領域を表します。Represents a contiguous region of memory, similar to ReadOnlySpan<T>. ReadOnlySpan<T> とは異なり、これは ByRef に似た型ではありません。Unlike ReadOnlySpan<T>, it is not a byref-like type.
generic <typename T>
public value class ReadOnlyMemory : IEquatable<ReadOnlyMemory<T>>
generic <typename T>
public value class ReadOnlyMemory
public struct ReadOnlyMemory<T> : IEquatable<ReadOnlyMemory<T>>
public struct ReadOnlyMemory<T>
type ReadOnlyMemory<'T> = struct
Public Structure ReadOnlyMemory(Of T)
Implements IEquatable(Of ReadOnlyMemory(Of T))
Public Structure ReadOnlyMemory(Of T)
型パラメーター
- T
メモリの連続する領域の読み取り元となるオブジェクトの種類。The object type from which the contiguous region of memory will be read.
- 継承
- 実装
コンストラクター
ReadOnlyMemory<T>(T[]) |
対象となる配列全体に新しいメモリ領域を作成します。Creates a new memory region over the entirety of the target array. |
ReadOnlyMemory<T>(T[], Int32, Int32) |
指定された位置を開始位置とし、指定された要素数を含む、対象となる配列の一部に新しいメモリ領域を作成します。Creates a new memory region over the portion of the target array beginning at a specified position and including a specified number of elements. |
プロパティ
Empty |
空の ReadOnlyMemory<T> を取得します。Gets an empty ReadOnlyMemory<T>. |
IsEmpty |
この読み取り専用メモリ領域が空かどうかを示す値を取得します。Gets a value that indicates whether this read-only memory region is empty. |
Length |
メモリ領域の項目数を取得します。Gets the number of items in the memory region. |
Span |
メモリ領域から範囲を取得します。Gets a span from the memory region. |
メソッド
CopyTo(Memory<T>) |
読み取り専用メモリ領域の内容をコピー先のメモリ領域にコピーします。Copies the contents of the read-only memory region into a destination memory region. |
Equals(Object) |
指定したオブジェクトが現在の読み取り専用メモリ領域と等しいかどうかを判断します。Determines whether the specified object is equal to the current read-only memory region. |
Equals(ReadOnlyMemory<T>) |
現在のインスタンスと指定した ReadOnlyMemory<T> オブジェクトが、等しいかどうかを判断します。Determines whether the current instance and a specified ReadOnlyMemory<T> objects are equal. |
GetHashCode() |
この ReadOnlyMemory<T> のハッシュ コードを返します。Returns the hash code for this ReadOnlyMemory<T>. |
Pin() |
メモリに対してハンドルを作成します。Creates a handle for the memory. |
Slice(Int32) |
指定した位置を開始位置とし、その最後まで続く、指定したメモリ領域からスライスを形成します。Forms a slice out of the given memory region, beginning at a specified poisition and continuing to its end. |
Slice(Int32, Int32) |
|
ToArray() |
メモリ範囲の内容を新しい配列にコピーします。Copies the contents from the memory region into a new array. |
ToString() |
この読み取り専用メモリ インスタンスの文字列表現を返します。Returns the string representation of this read-only memory instance. |
TryCopyTo(Memory<T>) |
コピー先に読み取り専用メモリの内容のコピーを試行し、コピー操作が成功したかどうかを示す値を返します。Tries to copy the contents of the readonly-only memory into the destination and returns a value that indicates whether the copy operation succeeded. |
演算子
Implicit(ArraySegment<T> to ReadOnlyMemory<T>) |
ArraySegment<T> から ReadOnlyMemory<T> への暗黙の型変換を定義します。Defines an implicit conversion of a ArraySegment<T> to a ReadOnlyMemory<T>. |
Implicit(T[] to ReadOnlyMemory<T>) |
配列から ReadOnlyMemory<T> への暗黙の型変換を定義します。Defines an implicit conversion of an array to a ReadOnlyMemory<T>. |
拡張メソッド
Trim<T>(ReadOnlyMemory<T>, T) |
指定された要素が先頭と末尾に現れる箇所をすべて、読み取り専用メモリ領域から削除します。Removes all leading and trailing occurrences of a specified element from a read-only memory region. |
Trim<T>(ReadOnlyMemory<T>, ReadOnlySpan<T>) |
読み取り専用スパンで指定された一連の要素が先頭と末尾に現れる箇所をすべて、読み取り専用メモリ領域から削除します。Removes all leading and trailing occurrences of a set of elements specified in a read-only span from a read-only memory region. |
TrimEnd<T>(ReadOnlyMemory<T>, T) |
指定された要素が末尾に現れる箇所をすべて、読み取り専用メモリ領域から削除します。Removes all trailing occurrences of a specified element from a read-only memory region. |
TrimEnd<T>(ReadOnlyMemory<T>, ReadOnlySpan<T>) |
読み取り専用スパンで指定された一連の要素が末尾に現れる箇所をすべて、読み取り専用メモリ領域から削除します。Removes all trailing occurrences of a set of elements specified in a read-only span from a read-only memory region. |
TrimStart<T>(ReadOnlyMemory<T>, T) |
指定された要素が先頭に現れる箇所をすべて、メモリ領域から削除します。Removes all leading occurrences of a specified element from a memory region. |
TrimStart<T>(ReadOnlyMemory<T>, ReadOnlySpan<T>) |
読み取り専用スパンで指定された一連の要素が先頭に現れる箇所をすべて、メモリ領域から削除します。Removes all leading occurrences of a set of elements specified in a read-only span from a memory region. |