error: future cannot be sent between threads safely
--> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/viz-core-0.7.0/src/handler/after.rs:27:48
|
27 | async fn call(&self, i: I) -> Self::Output {
| ________________________________________________^
28 | | self.f.call(self.h.call(i).await).await
29 | | }
| |_____^ future created by async block is not `Send`
|
note: future is not `Send` as this value is used across an await
--> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/viz-core-0.7.0/src/handler/after.rs:28:43
|
28 | self.f.call(self.h.call(i).await).await
| -------------------- ^^^^^ await occurs here, with `self.h.call(i).await` maybe used later
| |
| has type `std::result::Result<O, error::Error>` which is not `Send`
29 | }
| - `self.h.call(i).await` is later dropped here
= note: required for the cast from `Pin<Box<...>>` to `Pin<Box<dyn Future<Output = Result<O, Error>> + Send>>`
= note: the full name for the source type has been written to '/root/repos/socketioxide/target/debug/deps/viz_core-fd165c2c8ce6133a.long-type-12905923365472627885.txt'
= note: the full name for the target type has been written to '/root/repos/socketioxide/target/debug/deps/viz_core-fd165c2c8ce6133a.long-type-15852316088634765815.txt'
help: consider further restricting type parameter `O`
|
23 | F: Handler<Result<O>, Output = Result<O>> + Clone, O: std::marker::Send
| ~~~~~~~~~~~~~~~~~~~~~~
Adding a Send bound here on the O generic seems to resolve the issue :
When trying to compile
viz-core
:Adding a
Send
bound here on theO
generic seems to resolve the issue :