语言

SwiftError 结构

定义

重要

此 API 不符合 CLS。

表示 Swift 错误上下文,指示参数为错误上下文。

public value class SwiftError
[System.CLSCompliant(false)]
public readonly struct SwiftError
[<System.CLSCompliant(false)>]
type SwiftError = struct
Public Structure SwiftError
继承
SwiftError
特性

示例

下面是如何声明 SwiftError 的示例:

[UnmanagedCallConv(CallConvs = [typeof(CallConvSwift)])]
[DllImport("SwiftLibrary", EntryPoint = "export")]
public static extern void swiftFunction(SwiftError* error);

注解

此结构用于从 Swift 函数中检索与.NET互操作上下文中的“错误”上下文。

构造函数

名称 说明
SwiftError(Void*)

使用指定的指针值创建 SwiftError 结构的新实例。

属性

名称 说明
Value

获取错误上下文的指针。

适用于