This crate contains two main types:
RawPromise, which is a thin
wrapper over JS's promise types, and
Promise, which helps use
promises with Rust types.
All methods that chain a promise currently translate to a
then call, even if the
result is available immediately. So doing as much synchronous work in one
will be slightly more efficient than multiple
In promise callbacks, if a panic or JS error occurs, the library will print the error
console.error and return
null from the promise.
- stdweb promises, at the time of writing, require a feature to access, and are unstable. This... is also unstable but not locked behind a feature.
- stdweb promises try to be compatible with the futures API, which does not map well to how JS promises and callbacks work. This crate exposes an API that mirrors JS's promises API.
Functions for passing arbitrary Rust values across the JS boundary and back to Rust, ex. as a return value from a promise.
Typed promises, working with Rust types.
Wrapper for a JS promise, working with
A non-error result from a promise; can be either an immediate Ok value, or another promise to execute.
Return type for