ReadOnlyMemory<T> Struct
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 contiguous region of memory, similar to ReadOnlySpan<T>. 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 readonly struct ReadOnlyMemory<T> : IEquatable<ReadOnlyMemory<T>>
public readonly 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.
- Inheritance
- Implements
Read |
Creates a new memory region over the portion of the target array beginning at a specified position and including a specified number of elements. |
Read |
Creates a new memory region over the entirety of the target array. |
Empty |
Gets an empty ReadOnlyMemory<T>. |
Is |
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. |
Copy |
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(Read |
Determines whether the current instance and a specified ReadOnlyMemory<T> objects are equal. |
Get |
Returns the hash code for this ReadOnlyMemory<T>. |
Pin() |
Creates a handle for the memory. |
Slice(Int32, Int32) |
Forms a slice out of the given memory region starting at |
Slice(Int32) |
Forms a slice out of the given memory region, beginning at a specified position and continuing to its end. |
To |
Copies the contents from the memory region into a new array. |
To |
Returns the string representation of this read-only memory instance. |
Try |
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(Array |
Defines an implicit conversion of a ArraySegment<T> to a ReadOnlyMemory<T>. |
Implicit(T[] to Read |
Defines an implicit conversion of an array to a ReadOnlyMemory<T>. |
Trim<T>(Read |
Removes all leading and trailing occurrences of a specified element from a read-only memory region. |
Trim<T>(Read |
Removes all leading and trailing occurrences of a set of elements specified in a read-only span from a read-only memory region. |
Trim |
Removes all trailing occurrences of a specified element from a read-only memory region. |
Trim |
Removes all trailing occurrences of a set of elements specified in a read-only span from a read-only memory region. |
Trim |
Removes all leading occurrences of a specified element from a memory region. |
Trim |
Removes all leading occurrences of a set of elements specified in a read-only span from a memory region. |
Produkt | Verze |
---|---|
.NET | Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided) |
.NET Standard | 2.0 (package-provided), 2.1 |
Zpětná vazba k produktu .NET
.NET je open source projekt. Vyberte odkaz pro poskytnutí zpětné vazby: