cloudflare / cloudflare/workers-rs

[Feature] Response::promise()

Open
#213 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
3.7k
Forks
429
Avg merge
20h 28m
Merged PRs (30d)
7

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Description

Do we have a wasm-bindgen example for a service "worker"?

>"the trait bound `worker::worker_sys::Response: std::convert::From` is not satisfied"

I see macro `wasm_bindgen_macro_support` which is [for streams](https://github.com/cloudflare/workers-rs/blob/main/worker-macros/src/event.rs#L79) but I just made an `async{block.await}` [into a future](https://stackoverflow.com/a/73353922/11711280) and now would like to bind/expand as a promise.

Should I try a `#[event(fetch, respond_with_errors)]` worker without `Result` {Ok(Response)} but `js_sys::Promise`, or without the former totally (I imagine not)?

edit: is [this](https://github.com/cloudflare/workers-rs/issues/112) the thing?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.