dermesser / integer-encoding-rs

Integer encoding for primitive integer types: Supports varint/varint+zigzag and fixed-length integer encoding and decoding, and provides synchronous and asynchronous Write/Read types for easily writing/reading integers.
Other
66 stars 16 forks source link

feat: remove not required `Send` bound #32

Closed dignifiedquire closed 1 year ago

dignifiedquire commented 1 year ago

The async traits don't actually require the use of the Send bound. This is required for us to make use of them in a wasm context, where we explicitly have !Send readers and writers.

Stebalien commented 1 year ago

FYI, this broke our car implementation. The fact that Send is no longer required means that the returned future is no longer Send, and there's no way to convince rust to abstract over it.

dermesser commented 1 year ago

@Stebalien would you mind trying the branch in #33 with your code? I am not quite sure how it interacts with the async_trait crate. In that case you can enable (by default) the feature sendable_io_traits (or disable it, in case of wasm targets).

Stebalien commented 1 year ago

Unfortunately I get the same error. But I have no idea why.

Here's a reproducer: https://github.com/filecoin-project/ref-fvm/tree/integer-encoding-send-error

Note: I found that we were actually using two varint crates (yours and unsigned-varint) so I ended up just switching over to the other one, so this isn't really an issue for us anymore.

dermesser commented 1 year ago

Unfortunately I get the same error. But I have no idea why.

Here's a reproducer: https://github.com/filecoin-project/ref-fvm/tree/integer-encoding-send-error

Note: I found that we were actually using two varint crates (yours and unsigned-varint) so I ended up just switching over to the other one, so this isn't really an issue for us anymore.

thank you, also for the reproduction case! I'm glad it is solved for you, I will look into whether it is still worth solving in general.