共用方式為


ReadOnlySpanMarshaller<T,TUnmanagedElement> 類別

定義

重要

此 API 不符合 CLS 規範。

支援從 Managed 值封送 ReadOnlySpan<T> 處理至專案之 Unmanaged 值的連續原生數位。

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)

類型參數

T

範圍的Managed項目類型。

TUnmanagedElement

範圍元素的 Unmanaged 型別。

繼承
ReadOnlySpanMarshaller<T,TUnmanagedElement>
屬性

備註

ReadOnlySpan<T>以這個封送處理器封送的封送處理會符合的GetReference<T>(ReadOnlySpan<T>)語意。 特別是,如果範圍是以非值建構,此封送處理器將會針對長度為零的範圍傳遞nullnull 值。

適用於