error: future cannot be sent between threads safely
--> src\handler\mod.rs:47:13
|
47 | friend_requests::send(uid, bytes).boxed()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `send` is not `Send`
|
= help: within `impl futures_util::Future<Output = std::result::Result<std::option::Option<Vec<u8>>, common::error::Error>>`, the trait `std::marker::Send` is not implemented for `*const seize::raw::collector::Reservation`
note: future is not `Send` as this value is used across an await
--> src\handler\mod.rs:187:54
|
186 | if let Some(sender) = SENDER_MAP.pin().get(&session.cid) {
| ---------------- has type `HashMapRef<'_, Arc<std::string::String>, tokio::sync::mpsc::Sender<CccpMessage>, RandomState, LocalGuard<'_>>` which is not `Send`
187 | publish(ty, content.clone(), sender).await;
| ^^^^^ await occurs here, with `SENDER_MAP.pin()` maybe used later
note: required by a bound in `moka::future::FutureExt::boxed`
--> C:\Users\LSHM\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\moka-0.12.10\src\future.rs:49:44
|
47 | fn boxed<'a, T>(self) -> BoxFuture<'a, T>
| ----- required by a bound in this associated function
48 | where
49 | Self: Future<Output = T> + Sized + Send + 'a,
| ^^^^ required by this bound in `FutureExt::boxed`
error: future cannot be sent between threads safely
--> src\handler\mod.rs:47:13
|
47 | friend_requests::send(uid, bytes).boxed()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `send` is not `Send`
|
= help: within `impl futures_util::Future<Output = std::result::Result<std::option::Option<Vec<u8>>, common::error::Error>>`, the trait `std::marker::Send` is not implemented for `*mut ()`
note: future is not `Send` as this value is used across an await
--> src\handler\mod.rs:187:54
|
186 | if let Some(sender) = SENDER_MAP.pin().get(&session.cid) {
| ---------------- has type `HashMapRef<'_, Arc<std::string::String>, tokio::sync::mpsc::Sender<CccpMessage>, RandomState, LocalGuard<'_>>` which is not `Send`
187 | publish(ty, content.clone(), sender).await;
| ^^^^^ await occurs here, with `SENDER_MAP.pin()` maybe used later
note: required by a bound in `moka::future::FutureExt::boxed`
--> C:\Users\LSHM\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\moka-0.12.10\src\future.rs:49:44
|
47 | fn boxed<'a, T>(self) -> BoxFuture<'a, T>
| ----- required by a bound in this associated function
48 | where
49 | Self: Future<Output = T> + Sized + Send + 'a,
| ^^^^ required by this bound in `FutureExt::boxed`
error: future cannot be sent between threads safely
--> src\net\acceptor.rs:13:9
|
13 | / tokio::spawn(async move {
14 | | process(stream).await;
15 | | });
| |__________^ future created by async block is not `Send`
|
= help: within `{async block@src\net\acceptor.rs:13:22: 13:32}`, the trait `std::marker::Send` is not implemented for `*const seize::raw::collector::Reservation`
note: future is not `Send` as this value is used across an await
--> src\handler\mod.rs:75:29
|
74 | if let Some(handler) = handlers_map.pin().get(&task_type) {
| ------------------ has type `HashMapRef<'_, u8, Box<dyn Fn(Arc<std::string::String>, std::option::Option<Vec<u8>>) -> Pin<Box<dyn futures_util::Future<Output = std::result::Result<std::option::Option<Vec<u8>>, common::error::Error>>>> + std::marker::Send + Sync>, RandomState, LocalGuard<'_>>` which is not `Send`
75 | handler(uid, bytes).await
| ^^^^^ await occurs here, with `handlers_map.pin()` maybe used later
note: required by a bound in `tokio::spawn`
--> C:\Users\LSHM\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\tokio-1.44.2\src\task\spawn.rs:168:21
|
166 | pub fn spawn<F>(future: F) -> JoinHandle<F::Output>
| ----- required by a bound in this function
167 | where
168 | F: Future + Send + 'static,
| ^^^^ required by this bound in `spawn`
error: future cannot be sent between threads safely
--> src\net\acceptor.rs:13:9
|
13 | / tokio::spawn(async move {
14 | | process(stream).await;
15 | | });
| |__________^ future created by async block is not `Send`
|
= help: the trait `std::marker::Send` is not implemented for `dyn futures_util::Future<Output = std::result::Result<std::option::Option<Vec<u8>>, common::error::Error>>`
note: future is not `Send` as it awaits another future which is not `Send`
--> src\handler\mod.rs:75:9
|
75 | handler(uid, bytes).await
| ^^^^^^^^^^^^^^^^^^^ await occurs here on type `Pin<Box<dyn futures_util::Future<Output = std::result::Result<std::option::Option<Vec<u8>>, common::error::Error>>>>`, which is not `Send`
note: required by a bound in `tokio::spawn`
--> C:\Users\LSHM\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\tokio-1.44.2\src\task\spawn.rs:168:21
|
166 | pub fn spawn<F>(future: F) -> JoinHandle<F::Output>
| ----- required by a bound in this function
167 | where
168 | F: Future + Send + 'static,
| ^^^^ required by this bound in `spawn`
error: future cannot be sent between threads safely
--> src\net\acceptor.rs:13:9
|
13 | / tokio::spawn(async move {
14 | | process(stream).await;
15 | | });
| |__________^ future created by async block is not `Send`
|
= help: within `{async block@src\net\acceptor.rs:13:22: 13:32}`, the trait `std::marker::Send` is not implemented for `*mut ()`
note: future is not `Send` as this value is used across an await
--> src\handler\mod.rs:75:29
|
74 | if let Some(handler) = handlers_map.pin().get(&task_type) {
| ------------------ has type `HashMapRef<'_, u8, Box<dyn Fn(Arc<std::string::String>, std::option::Option<Vec<u8>>) -> Pin<Box<dyn futures_util::Future<Output = std::result::Result<std::option::Option<Vec<u8>>, common::error::Error>>>> + std::marker::Send + Sync>, RandomState, LocalGuard<'_>>` which is not `Send`
75 | handler(uid, bytes).await
| ^^^^^ await occurs here, with `handlers_map.pin()` maybe used later
note: required by a bound in `tokio::spawn`
--> C:\Users\LSHM\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\tokio-1.44.2\src\task\spawn.rs:168:21
|
166 | pub fn spawn<F>(future: F) -> JoinHandle<F::Output>
| ----- required by a bound in this function
167 | where
168 | F: Future + Send + 'static,
| ^^^^ required by this bound in `spawn`