BlockSource
Requiring Send
trait
#1827
Replies: 2 comments 2 replies
-
Are there any steps to reproduce this?
|
Beta Was this translation helpful? Give feedback.
-
Grrr, that's more than a little annoying. This really shouldn't matter at all - there's no threading in wasm, so Really we're being limited by lack of There's no easy way around this upstream until then (maybe eventually, now that GATs are stable?) - we'd really have to split the You should be able to work around it downstream, though. If you wrap the |
Beta Was this translation helpful? Give feedback.
-
In order to implement
BlockSource
, we need to implementAsyncBlockSourceResult
for its return type, which requiresSend
.For other projects I've used, this hasn't been a problem. However I'm working on a wasm project now and we get some errors around the
Send
trait when trying to use BDK:Example code:
I think the important one to pay attention to here is:
We still have a lot to learn about
wasm-bindgen
and rust in general, but it looks like it implements!Send
but notSend
? https://rustwasm.github.io/wasm-bindgen/api/wasm_bindgen_futures/struct.JsFuture.htmlI guess I wanted to open up discussion on some options here we were considering.
Confirm
trait instead - we noticed this comment: Add get raw block endpoint bitcoindevkit/rust-esplora-client#25 (review)JsFuture
to beSend
compatibleSend
here or not.Beta Was this translation helpful? Give feedback.
All reactions