Struct neon::types::Deferred[][src]

pub struct Deferred { /* fields omitted */ }
This is supported on crate feature promise-api only.
Expand description

Deferred is a handle that can be used to resolve or reject a JsPromise

It is recommended to settle a Deferred with Deferred::settle_with to ensure exceptions are caught.

On Node-API versions less than 6, dropping a Deferred without settling will cause a panic. On Node-API 6+, the associated JsPromise will be automatically rejected.

Implementations

Resolve a JsPromise with a JavaScript value

Reject a JsPromise with a JavaScript value

Resolve or reject a JsPromise with the result of a closure

If the closure throws, the promise will be rejected with the promise

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.