ReadOnlySpanMarshaller<T,TUnmanagedElement> 类

定义

重要

此 API 不符合 CLS。

支持从托管值封送 ReadOnlySpan<T> 到元素的非托管值的连续本机数组。

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

范围的托管元素类型。

TUnmanagedElement

范围元素的非托管类型。

继承
ReadOnlySpanMarshaller<T,TUnmanagedElement>
属性

注解

ReadOnlySpan<T>使用此封送处理程序封送的 将匹配 的GetReference<T>(ReadOnlySpan<T>)语义。 具体而言,如果范围是使用非null 值构造的,则此封送程序将为零长度范围传递非null 值。

适用于