AsyncVoidMethodBuilder 结构

定义

表示不返回值的异步方法生成器。Represents a builder for asynchronous methods that do not return a value.

public value class AsyncVoidMethodBuilder
public struct AsyncVoidMethodBuilder
type AsyncVoidMethodBuilder = struct
Public Structure AsyncVoidMethodBuilder
继承
AsyncVoidMethodBuilder

注解

此类型及其成员旨在供编译器使用。This type and its members are intended for use by the compiler.

方法

AwaitOnCompleted<TAwaiter,TStateMachine>(TAwaiter, TStateMachine)

指定的 Awaiter 完成时,安排状态机以继续下一操作。Schedules the state machine to proceed to the next action when the specified awaiter completes.

AwaitUnsafeOnCompleted<TAwaiter,TStateMachine>(TAwaiter, TStateMachine)

指定的 Awaiter 完成时,安排状态机以继续下一操作。Schedules the state machine to proceed to the next action when the specified awaiter completes. 可从部分受信任的代码调用此方法。This method can be called from partially trusted code.

Create()

创建 AsyncVoidMethodBuilder 类的实例。Creates an instance of the AsyncVoidMethodBuilder class.

SetException(Exception)

将一个异常绑定到该方法生成器。Binds an exception to the method builder.

SetResult()

标记此方法生成器为成功完成。Marks the method builder as successfully completed.

SetStateMachine(IAsyncStateMachine)

将生成器与指定的状态机相关联。Associates the builder with the specified state machine.

Start<TStateMachine>(TStateMachine)

开始运行具有关联状态机的生成器。Begins running the builder with the associated state machine.

适用于