語言

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);

備註

此結構用於在與 .NET 互操作的情境中,從 Swift 函式中取得「錯誤」上下文。

建構函式

名稱 Description
SwiftError(Void*)

建立一個新的 SwiftError 結構體實例,並設定指定的指標值。

屬性

名稱 Description
Value

取得錯誤上下文的指標。

適用於