ReadOnlyMemory<T> Yapı
Tanım
Benzer bir bellek bölgesini temsil eder ReadOnlySpan<T> .Represents a contiguous region of memory, similar to ReadOnlySpan<T>. Aksine ReadOnlySpan<T> , ByRef benzeri bir tür değildir.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ür Parametreleri
- T
Ardışık bellek bölgesinin okunacaktır nesne türü.The object type from which the contiguous region of memory will be read.
- Devralma
- Uygulamalar
Oluşturucular
ReadOnlyMemory<T>(T[]) |
Hedef dizinin tamamı üzerinde yeni bir bellek bölgesi oluşturur.Creates a new memory region over the entirety of the target array. |
ReadOnlyMemory<T>(T[], Int32, Int32) |
Belirtilen konumdan başlayan ve belirtilen sayıda öğe dahil olmak üzere hedef dizinin bölümü üzerinde yeni bir bellek bölgesi oluşturur.Creates a new memory region over the portion of the target array beginning at a specified position and including a specified number of elements. |
Özellikler
Empty |
Boş alan alır ReadOnlyMemory<T> .Gets an empty ReadOnlyMemory<T>. |
IsEmpty |
Bu salt okuma bellek bölgesinin boş olup olmadığını gösteren bir değer alır.Gets a value that indicates whether this read-only memory region is empty. |
Length |
Bellek bölgesindeki öğelerin sayısını alır.Gets the number of items in the memory region. |
Span |
Bellek bölgesinden bir yayılma alır.Gets a span from the memory region. |
Yöntemler
CopyTo(Memory<T>) |
Salt okuma bellek bölgesinin içeriğini bir hedef bellek bölgesine kopyalar.Copies the contents of the read-only memory region into a destination memory region. |
Equals(Object) |
Belirtilen nesnenin geçerli Salt okunabilir bellek bölgesine eşit olup olmadığını belirler.Determines whether the specified object is equal to the current read-only memory region. |
Equals(ReadOnlyMemory<T>) |
Geçerli örneğin ve belirtilen nesnelerin eşit olup olmadığını belirler ReadOnlyMemory<T> .Determines whether the current instance and a specified ReadOnlyMemory<T> objects are equal. |
GetHashCode() |
Bunun için karma kodu döndürür ReadOnlyMemory<T> .Returns the hash code for this ReadOnlyMemory<T>. |
Pin() |
Bellek için bir tanıtıcı oluşturur.Creates a handle for the memory. |
Slice(Int32) |
Belirtilen bir poisition başlayarak ve sonuna kadar verilen bellek bölgesinin bir dilimini oluşturur.Forms a slice out of the given memory region, beginning at a specified poisition and continuing to its end. |
Slice(Int32, Int32) |
Öğeler için konumdan başlayarak verilen bellek bölgesinin bir dilimini oluşturur |
ToArray() |
Bellek bölgesindeki içeriği yeni bir diziye kopyalar.Copies the contents from the memory region into a new array. |
ToString() |
Bu salt okunurdur bellek örneğinin dize gösterimini döndürür.Returns the string representation of this read-only memory instance. |
TryCopyTo(Memory<T>) |
Salt okunur belleğin içeriğini hedefe kopyalamayı dener ve kopyalama işleminin başarılı olup olmadığını gösteren bir değer döndürür.Tries to copy the contents of the readonly-only memory into the destination and returns a value that indicates whether the copy operation succeeded. |
İşleçler
Implicit(ArraySegment<T> to ReadOnlyMemory<T>) |
' A örtülü dönüşümünü tanımlar ArraySegment<T> ReadOnlyMemory<T> .Defines an implicit conversion of a ArraySegment<T> to a ReadOnlyMemory<T>. |
Implicit(T[] to ReadOnlyMemory<T>) |
Bir dizinin örtük bir şekilde dönüştürülmesini tanımlar ReadOnlyMemory<T> .Defines an implicit conversion of an array to a ReadOnlyMemory<T>. |
Uzantı Metotları
Trim<T>(ReadOnlyMemory<T>, T) |
Belirli bir öğenin tüm önde gelen ve sondaki oluşumlarını salt bir salt okunurdur.Removes all leading and trailing occurrences of a specified element from a read-only memory region. |
Trim<T>(ReadOnlyMemory<T>, ReadOnlySpan<T>) |
Salt okunabilir bir bellek bölgesinden salt okunurdur bir yayılma alanında belirtilen bir öğe kümesinin tüm önde gelen ve sondaki oluşumlarını kaldırır.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) |
Bir salt okuma bellek bölgesinden belirtilen öğenin tüm sondaki oluşumlarını kaldırır.Removes all trailing occurrences of a specified element from a read-only memory region. |
TrimEnd<T>(ReadOnlyMemory<T>, ReadOnlySpan<T>) |
Salt okunabilir bir bellek bölgesinden salt okunurdur olan bir öğe kümesinin tüm sondaki oluşumlarını kaldırır.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) |
Belirtilen öğenin tüm önde gelen oluşumlarını bir bellek bölgesinden kaldırır.Removes all leading occurrences of a specified element from a memory region. |
TrimStart<T>(ReadOnlyMemory<T>, ReadOnlySpan<T>) |
Bir bellek bölgesinden salt okunurdur bir yayılma alanında belirtilen bir öğe kümesinin tüm önde gelen oluşumlarını kaldırır.Removes all leading occurrences of a set of elements specified in a read-only span from a memory region. |