Closed m0ppers closed 2 years ago
Good catch, could you create a PR with that?
Yes, it is the because of wasm, but we could have two version of that trait. Using the
#[cfg(not(target_arch = "wasm32"))]
#[async_trait()]
pub trait HttpLowLevel<M = http::Method, H = http::HeaderMap> {
#[cfg(target_arch = "wasm32")]
#[async_trait(?Send)]
pub trait HttpLowLevel<M = http::Method, H = http::HeaderMap> {
This makes it non-trivial to use it in https://github.com/tokio-rs/axum/ as that would require Futures to be
Send
. It is explicitly marked as ?Send here: https://github.com/typesense/typesense-rust/blob/97ce33dad948335a6ebd238a332ad29b002ab93f/typesense/src/transport/http_low_level.rs#L16When I just remove the
?Send
stuff it works for me so I am wondering if it can be safely removed? Is this because of wasm ?