Thanks, unfortunately I can't get your code to compile. It looks like the multipart field can't be sent across threads? so it gives this error on the web::block
line:
error[E0277]: `std::rc::Rc<std::cell::RefCell<actix_multipart::server::InnerField>>` cannot be sent between threads safely
--> src/main.rs:31:5
|
31 | web::block(move || {
| _____^^^^^^^^^^_-
| | |
| | `std::rc::Rc<std::cell::RefCell<actix_multipart::server::InnerField>>` cannot be sent between threads safely
32 | | let mut archive = tar::Archive::new(blocking);
33 | | archive.unpack("./out")
34 | | });
| |_____- within this `[closure@src/main.rs:31:16: 34:6 blocking:upload::utils::BlockingRead<async_compression::tokio_02::bufread::XzDecoder<tokio::io::StreamReader<futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>, actix_web::web::Bytes>>>]`
|
::: /home/<user>/.cargo/registry/src/github.com-1ecc6299db9ec823/actix-web-3.0.2/src/web.rs:279:35
|
279 | F: FnOnce() -> Result<I, E> + Send + 'static,
| ---- required by this bound in `actix_web::web::block`
|
= help: within `[closure@src/main.rs:31:16: 34:6 blocking:upload::utils::BlockingRead<async_compression::tokio_02::bufread::XzDecoder<tokio::io::StreamReader<futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>, actix_web::web::Bytes>>>]`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<std::cell::RefCell<actix_multipart::server::InnerField>>`
= note: required because it appears within the type `actix_multipart::Field`
= note: required because it appears within the type `futures::stream::IntoStream<actix_multipart::Field>`
= note: required because it appears within the type `futures::stream::Map<futures::stream::IntoStream<actix_multipart::Field>, futures_util::fns::MapErrFn<[closure@src/main.rs:27:23: 27:36]>>`
= note: required because it appears within the type `futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>`
= note: required because it appears within the type `tokio::io::StreamReader<futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>, actix_web::web::Bytes>`
= note: required because it appears within the type `async_compression::tokio_02::bufread::generic::decoder::Decoder<tokio::io::StreamReader<futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>, actix_web::web::Bytes>, async_compression::codec::xz::decoder::XzDecoder>`
= note: required because it appears within the type `async_compression::tokio_02::bufread::XzDecoder<tokio::io::StreamReader<futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>, actix_web::web::Bytes>>`
= note: required because it appears within the type `upload::utils::BlockingRead<async_compression::tokio_02::bufread::XzDecoder<tokio::io::StreamReader<futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>, actix_web::web::Bytes>>>`
= note: required because it appears within the type `[closure@src/main.rs:31:16: 34:6 blocking:upload::utils::BlockingRead<async_compression::tokio_02::bufread::XzDecoder<tokio::io::StreamReader<futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>, actix_web::web::Bytes>>>]`
error[E0277]: `std::rc::Rc<std::marker::PhantomData<bool>>` cannot be sent between threads safely
--> src/main.rs:31:5
|
31 | web::block(move || {
| _____^^^^^^^^^^_-
| | |
| | `std::rc::Rc<std::marker::PhantomData<bool>>` cannot be sent between threads safely
32 | | let mut archive = tar::Archive::new(blocking);
33 | | archive.unpack("./out")
34 | | });
| |_____- within this `[closure@src/main.rs:31:16: 34:6 blocking:upload::utils::BlockingRead<async_compression::tokio_02::bufread::XzDecoder<tokio::io::StreamReader<futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>, actix_web::web::Bytes>>>]`
|
::: /home/<user>/.cargo/registry/src/github.com-1ecc6299db9ec823/actix-web-3.0.2/src/web.rs:279:35
|
279 | F: FnOnce() -> Result<I, E> + Send + 'static,
| ---- required by this bound in `actix_web::web::block`
|
= help: within `[closure@src/main.rs:31:16: 34:6 blocking:upload::utils::BlockingRead<async_compression::tokio_02::bufread::XzDecoder<tokio::io::StreamReader<futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>, actix_web::web::Bytes>>>]`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<std::marker::PhantomData<bool>>`
= note: required because it appears within the type `actix_multipart::server::Safety`
= note: required because it appears within the type `actix_multipart::Field`
= note: required because it appears within the type `futures::stream::IntoStream<actix_multipart::Field>`
= note: required because it appears within the type `futures::stream::Map<futures::stream::IntoStream<actix_multipart::Field>, futures_util::fns::MapErrFn<[closure@src/main.rs:27:23: 27:36]>>`
= note: required because it appears within the type `futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>`
= note: required because it appears within the type `tokio::io::StreamReader<futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>, actix_web::web::Bytes>`
= note: required because it appears within the type `async_compression::tokio_02::bufread::generic::decoder::Decoder<tokio::io::StreamReader<futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>, actix_web::web::Bytes>, async_compression::codec::xz::decoder::XzDecoder>`
= note: required because it appears within the type `async_compression::tokio_02::bufread::XzDecoder<tokio::io::StreamReader<futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>, actix_web::web::Bytes>>`
= note: required because it appears within the type `upload::utils::BlockingRead<async_compression::tokio_02::bufread::XzDecoder<tokio::io::StreamReader<futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>, actix_web::web::Bytes>>>`
= note: required because it appears within the type `[closure@src/main.rs:31:16: 34:6 blocking:upload::utils::BlockingRead<async_compression::tokio_02::bufread::XzDecoder<tokio::io::StreamReader<futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>, actix_web::web::Bytes>>>]`
error[E0277]: `std::rc::Rc<std::cell::Cell<bool>>` cannot be sent between threads safely
--> src/main.rs:31:5
|
31 | web::block(move || {
| _____^^^^^^^^^^_-
| | |
| | `std::rc::Rc<std::cell::Cell<bool>>` cannot be sent between threads safely
32 | | let mut archive = tar::Archive::new(blocking);
33 | | archive.unpack("./out")
34 | | });
| |_____- within this `[closure@src/main.rs:31:16: 34:6 blocking:upload::utils::BlockingRead<async_compression::tokio_02::bufread::XzDecoder<tokio::io::StreamReader<futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>, actix_web::web::Bytes>>>]`
|
::: /home/<user>/.cargo/registry/src/github.com-1ecc6299db9ec823/actix-web-3.0.2/src/web.rs:279:35
|
279 | F: FnOnce() -> Result<I, E> + Send + 'static,
| ---- required by this bound in `actix_web::web::block`
|
= help: within `[closure@src/main.rs:31:16: 34:6 blocking:upload::utils::BlockingRead<async_compression::tokio_02::bufread::XzDecoder<tokio::io::StreamReader<futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>, actix_web::web::Bytes>>>]`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<std::cell::Cell<bool>>`
= note: required because it appears within the type `actix_multipart::server::Safety`
= note: required because it appears within the type `actix_multipart::Field`
= note: required because it appears within the type `futures::stream::IntoStream<actix_multipart::Field>`
= note: required because it appears within the type `futures::stream::Map<futures::stream::IntoStream<actix_multipart::Field>, futures_util::fns::MapErrFn<[closure@src/main.rs:27:23: 27:36]>>`
= note: required because it appears within the type `futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>`
= note: required because it appears within the type `tokio::io::StreamReader<futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>, actix_web::web::Bytes>`
= note: required because it appears within the type `async_compression::tokio_02::bufread::generic::decoder::Decoder<tokio::io::StreamReader<futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>, actix_web::web::Bytes>, async_compression::codec::xz::decoder::XzDecoder>`
= note: required because it appears within the type `async_compression::tokio_02::bufread::XzDecoder<tokio::io::StreamReader<futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>, actix_web::web::Bytes>>`
= note: required because it appears within the type `upload::utils::BlockingRead<async_compression::tokio_02::bufread::XzDecoder<tokio::io::StreamReader<futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>, actix_web::web::Bytes>>>`
= note: required because it appears within the type `[closure@src/main.rs:31:16: 34:6 blocking:upload::utils::BlockingRead<async_compression::tokio_02::bufread::XzDecoder<tokio::io::StreamReader<futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>, actix_web::web::Bytes>>>]`
error[E0277]: `std::rc::Rc<()>` cannot be sent between threads safely
--> src/main.rs:31:5
|
31 | web::block(move || {
| _____^^^^^^^^^^_-
| | |
| | `std::rc::Rc<()>` cannot be sent between threads safely
32 | | let mut archive = tar::Archive::new(blocking);
33 | | archive.unpack("./out")
34 | | });
| |_____- within this `[closure@src/main.rs:31:16: 34:6 blocking:upload::utils::BlockingRead<async_compression::tokio_02::bufread::XzDecoder<tokio::io::StreamReader<futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>, actix_web::web::Bytes>>>]`
|
::: /home/<user>/.cargo/registry/src/github.com-1ecc6299db9ec823/actix-web-3.0.2/src/web.rs:279:35
|
279 | F: FnOnce() -> Result<I, E> + Send + 'static,
| ---- required by this bound in `actix_web::web::block`
|
= help: within `[closure@src/main.rs:31:16: 34:6 blocking:upload::utils::BlockingRead<async_compression::tokio_02::bufread::XzDecoder<tokio::io::StreamReader<futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>, actix_web::web::Bytes>>>]`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<()>`
= note: required because it appears within the type `std::marker::PhantomData<std::rc::Rc<()>>`
= note: required because it appears within the type `actix_utils::task::LocalWaker`
= note: required because it appears within the type `actix_multipart::server::Safety`
= note: required because it appears within the type `actix_multipart::Field`
= note: required because it appears within the type `futures::stream::IntoStream<actix_multipart::Field>`
= note: required because it appears within the type `futures::stream::Map<futures::stream::IntoStream<actix_multipart::Field>, futures_util::fns::MapErrFn<[closure@src/main.rs:27:23: 27:36]>>`
= note: required because it appears within the type `futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>`
= note: required because it appears within the type `tokio::io::StreamReader<futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>, actix_web::web::Bytes>`
= note: required because it appears within the type `async_compression::tokio_02::bufread::generic::decoder::Decoder<tokio::io::StreamReader<futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>, actix_web::web::Bytes>, async_compression::codec::xz::decoder::XzDecoder>`
= note: required because it appears within the type `async_compression::tokio_02::bufread::XzDecoder<tokio::io::StreamReader<futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>, actix_web::web::Bytes>>`
= note: required because it appears within the type `upload::utils::BlockingRead<async_compression::tokio_02::bufread::XzDecoder<tokio::io::StreamReader<futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>, actix_web::web::Bytes>>>`
= note: required because it appears within the type `[closure@src/main.rs:31:16: 34:6 blocking:upload::utils::BlockingRead<async_compression::tokio_02::bufread::XzDecoder<tokio::io::StreamReader<futures::stream::MapErr<actix_multipart::Field, [closure@src/main.rs:27:23: 27:36]>, actix_web::web::Bytes>>>]`
error: aborting due to 4 previous errors; 4 warnings emitted
For more information about this error, try `rustc --explain E0277`.
error: could not compile `upload`.
To learn more, run the command again with --verbose.