Generic Instance Method 総称体インスタンスメソッド

resume(with:)

Resume the task that’s awaiting the continuation by returning or throwing the given result value. 与えられた結果値をスローするまたは返すことによって、継続を待っているタスクを再開します。

Declaration 宣言

func resume<Er>(with result: Result<T, Er>) where E == Error, Er : Error

Parameters パラメータ

result

The result. If it contains a .success value, the continuation returns that value; otherwise, it throws the .error value. その結果。それが.success値を含むならば、継続はその値を返します;そうでなければ、それは.error値をスローします。

Discussion 解説

A continuation must be resumed exactly once. If the continuation has already resumed, then calling this method results in undefined behavior. 継続は、厳密に一度だけ再開されなければなりません。継続が既に再開してしまっているならば、そのときこの関数を呼び出すことは未定義の挙動という結果になります。

After calling this method, control immediately returns to the caller. The task continues executing when its executor schedules it. このメソッドを呼び出した後、制御はすぐに呼び出し側に返ります。タスクは、それのエグゼキュータがそれを予定する場合は遂行を継続します。