A value-taking function (first arg to new Promise callback)
An error-taking function (second arg to new Promise callback)
The result you want to settle the promise with. An error will be thrown if it's undefined.
If the result is an error, it is marked as handled.
Fulfill a Promise from a Result
If the result is a CancelResult, the promise is rejected with a CancelError. Otherwise it is resolved or rejected according to the state of the result.