mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-04-01 09:51:06 +00:00
This PR contains a few major improvements: * Code duplication has been removed. * Everything has been refactored so that the implementation is much easier to understand. * `future_to_promise` is now implemented with `spawn_local` rather than the other way around (this means `spawn_local` is faster since it doesn't need to create an unneeded `Promise`). * Both the single threaded and multi threaded executors have been rewritten from scratch: * They only create 1-2 allocations in Rust per Task, and all of the allocations happen when the Task is created. * The singlethreaded executor creates 1 Promise per tick, rather than 1 Promise per tick per Task. * Both executors do *not* create `Closure`s during polling, instead all needed `Closure`s are created ahead of time. * Both executors now have correct behavior with regard to spurious wakeups and waking up during the call to `poll`. * Both executors cache the `Waker` so it doesn't need to be recreated all the time. I believe both executors are now optimal in terms of both Rust and JS performance.
51 lines
2.7 KiB
Plaintext
51 lines
2.7 KiB
Plaintext
error[E0277]: the trait bound `std::result::Result<(), ()>: wasm_bindgen::__rt::IntoJsResult` is not satisfied
|
|
--> $DIR/async-errors.rs:30:1
|
|
|
|
|
30 | #[wasm_bindgen]
|
|
| ^^^^^^^^^^^^^^^ the trait `wasm_bindgen::__rt::IntoJsResult` is not implemented for `std::result::Result<(), ()>`
|
|
|
|
|
= help: the following implementations were found:
|
|
<std::result::Result<(), E> as wasm_bindgen::__rt::IntoJsResult>
|
|
<std::result::Result<T, E> as wasm_bindgen::__rt::IntoJsResult>
|
|
= note: required by `wasm_bindgen::__rt::IntoJsResult::into_js_result`
|
|
|
|
error[E0277]: the trait bound `std::result::Result<(), BadType>: wasm_bindgen::__rt::IntoJsResult` is not satisfied
|
|
--> $DIR/async-errors.rs:32:1
|
|
|
|
|
32 | #[wasm_bindgen]
|
|
| ^^^^^^^^^^^^^^^ the trait `wasm_bindgen::__rt::IntoJsResult` is not implemented for `std::result::Result<(), BadType>`
|
|
|
|
|
= help: the following implementations were found:
|
|
<std::result::Result<(), E> as wasm_bindgen::__rt::IntoJsResult>
|
|
<std::result::Result<T, E> as wasm_bindgen::__rt::IntoJsResult>
|
|
= note: required by `wasm_bindgen::__rt::IntoJsResult::into_js_result`
|
|
|
|
error[E0277]: the trait bound `wasm_bindgen::JsValue: std::convert::From<BadType>` is not satisfied
|
|
--> $DIR/async-errors.rs:34:1
|
|
|
|
|
34 | #[wasm_bindgen]
|
|
| ^^^^^^^^^^^^^^^ the trait `std::convert::From<BadType>` is not implemented for `wasm_bindgen::JsValue`
|
|
|
|
|
= help: the following implementations were found:
|
|
<wasm_bindgen::JsValue as std::convert::From<&'a T>>
|
|
<wasm_bindgen::JsValue as std::convert::From<&'a std::string::String>>
|
|
<wasm_bindgen::JsValue as std::convert::From<&'a str>>
|
|
<wasm_bindgen::JsValue as std::convert::From<MyType>>
|
|
and 61 others
|
|
= note: required because of the requirements on the impl of `std::convert::Into<wasm_bindgen::JsValue>` for `BadType`
|
|
= note: required because of the requirements on the impl of `wasm_bindgen::__rt::IntoJsResult` for `BadType`
|
|
= note: required by `wasm_bindgen::__rt::IntoJsResult::into_js_result`
|
|
|
|
error[E0277]: the trait bound `std::result::Result<BadType, wasm_bindgen::JsValue>: wasm_bindgen::__rt::IntoJsResult` is not satisfied
|
|
--> $DIR/async-errors.rs:36:1
|
|
|
|
|
36 | #[wasm_bindgen]
|
|
| ^^^^^^^^^^^^^^^ the trait `wasm_bindgen::__rt::IntoJsResult` is not implemented for `std::result::Result<BadType, wasm_bindgen::JsValue>`
|
|
|
|
|
= help: the following implementations were found:
|
|
<std::result::Result<(), E> as wasm_bindgen::__rt::IntoJsResult>
|
|
<std::result::Result<T, E> as wasm_bindgen::__rt::IntoJsResult>
|
|
= note: required by `wasm_bindgen::__rt::IntoJsResult::into_js_result`
|
|
|
|
For more information about this error, try `rustc --explain E0277`.
|