ReadOnlySpanMarshaller<T,TUnmanagedElement> Třída

Definice

Důležité

Toto rozhraní API neodpovídá specifikaci CLS.

Podporuje zařazování ReadOnlySpan<T> ze spravované hodnoty do souvislého nativního pole nespravovaných hodnot prvků.

generic <typename T, typename TUnmanagedElement>
 where TUnmanagedElement : value classpublic ref class ReadOnlySpanMarshaller abstract sealed
[System.CLSCompliant(false)]
[System.Runtime.InteropServices.Marshalling.ContiguousCollectionMarshaller]
[System.Runtime.InteropServices.Marshalling.CustomMarshaller(typeof(System.ReadOnlySpan<>), System.Runtime.InteropServices.Marshalling.MarshalMode.ManagedToUnmanagedIn, typeof(System.Runtime.InteropServices.Marshalling.ReadOnlySpanMarshaller<,>+ManagedToUnmanagedIn))]
[System.Runtime.InteropServices.Marshalling.CustomMarshaller(typeof(System.ReadOnlySpan<>), System.Runtime.InteropServices.Marshalling.MarshalMode.UnmanagedToManagedOut, typeof(System.Runtime.InteropServices.Marshalling.ReadOnlySpanMarshaller<,>+UnmanagedToManagedOut))]
public static class ReadOnlySpanMarshaller<T,TUnmanagedElement> where TUnmanagedElement : struct
[<System.CLSCompliant(false)>]
[<System.Runtime.InteropServices.Marshalling.ContiguousCollectionMarshaller>]
[<System.Runtime.InteropServices.Marshalling.CustomMarshaller(typeof(System.ReadOnlySpan<>), System.Runtime.InteropServices.Marshalling.MarshalMode.ManagedToUnmanagedIn, typeof(System.Runtime.InteropServices.Marshalling.ReadOnlySpanMarshaller<,>+ManagedToUnmanagedIn))>]
[<System.Runtime.InteropServices.Marshalling.CustomMarshaller(typeof(System.ReadOnlySpan<>), System.Runtime.InteropServices.Marshalling.MarshalMode.UnmanagedToManagedOut, typeof(System.Runtime.InteropServices.Marshalling.ReadOnlySpanMarshaller<,>+UnmanagedToManagedOut))>]
type ReadOnlySpanMarshaller<'T, 'UnmanagedElement (requires 'UnmanagedElement : struct)> = class
Public Class ReadOnlySpanMarshaller(Of T, TUnmanagedElement)

Parametry typu

T

Typ spravovaného elementu span.

TUnmanagedElement

Nespravovaný typ pro prvky rozsahu.

Dědičnost
ReadOnlySpanMarshaller<T,TUnmanagedElement>
Atributy

Poznámky

Sémantika ReadOnlySpan<T> s tímto zařazovačem bude odpovídat sémantice .GetReference<T>(ReadOnlySpan<T>) Konkrétně tento zařašovač předá hodnotu nenull pro rozsah nulové délky, pokud byl rozsah vytvořen s nehodnotounull .

Platí pro