AsyncTaskMethodBuilder<TResult> Struct
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a builder for asynchronous methods that returns a task and provides a parameter for the result.
generic <typename TResult>
public value class AsyncTaskMethodBuilder
public struct AsyncTaskMethodBuilder<TResult>
type AsyncTaskMethodBuilder<'Result> = struct
Public Structure AsyncTaskMethodBuilder(Of TResult)
Type Parameters
- TResult
The result to use to complete the task.
- Inheritance
Remarks
This type and its members are intended for use by the compiler.
Properties
Task |
Gets the task for this builder. |
Methods
AwaitOnCompleted<TAwaiter,TStateMachine>(TAwaiter, TStateMachine) |
Schedules the state machine to proceed to the next action when the specified awaiter completes. |
AwaitUnsafeOnCompleted<TAwaiter,TStateMachine>(TAwaiter, TStateMachine) |
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() |
Creates an instance of the AsyncTaskMethodBuilder<TResult> class. |
SetException(Exception) |
Marks the task as failed and binds the specified exception to the task. |
SetResult(TResult) |
Marks the task 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. |
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback을 참조하세요.
출시 예정: 2024년 내내 콘텐츠 피드백 메커니즘인 GitHub 문제를 단계적으로 폐지하고 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은다음에 대한 사용자 의견 제출 및 보기