Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- error[E0277]: `std::sync::MutexGuard<'_, imagedb::ImageDb<ImageMetadata, imagedb::FileStorage<ImageMetadata>>>` cannot be sent between threads safely
- --> src\main.rs:125:10
- |
- 125 | .serve(move || {
- | ^^^^^ `std::sync::MutexGuard<'_, imagedb::ImageDb<ImageMetadata, imagedb::FileStorage<ImageMetadata>>>` cannot be sent between threads safely
- |
- = help: within `impl std::future::Future`, the trait `for<'r> std::marker::Send` is not implemented for `std::sync::MutexGuard<'_, imagedb::ImageDb<ImageMetadata, imagedb::FileStorage<ImageMetadata>>>`
- = note: required because it appears within the type `for<'r, 's, 't0, 't1, 't2> {fn(std::result::Result<hyper::body::chunk::Chunk, http::status::StatusCode>) -> std::result::Result<<std::result::Result<hyper::body::chunk::Chunk, http::status::StatusCode> as std::ops::Try>::Ok, <std::result::Result<hyper::body::chunk::Chunk, http::status::StatusCode> as std::ops::Try>::Error> {<std::result::Result<hyper::body::chunk::Chunk, http::status::StatusCode> as std::ops::Try>::into_result}, futures::stream::concat::Concat2<hyper::body::body::Body>, tokio_async_await::compat::forward::Compat<futures::stream::concat::Concat2<hyper::body::body::Body>>, (), hyper::body::chunk::Chunk, contract::Update, i64, std::option::Option<(&'r contract::User, &'s std::string::String)>, &'t0 contract::User, &'t1 std::string::String, fn(std::result::Result<contract::File, http::status::StatusCode>) -> std::result::Result<<std::result::Result<contract::File, http::status::StatusCode> as std::ops::Try>::Ok, <std::result::Result<contract::File, http::status::StatusCode> as std::ops::Try>::Error> {<std::result::Result<contract::File, http::status::StatusCode> as std::ops::Try>::into_result}, impl futures::future::Future, tokio_async_await::compat::forward::Compat<impl futures::future::Future>, contract::File, std::string::String, fn(std::result::Result<bytes::bytes::Bytes, http::status::StatusCode>) -> std::result::Result<<std::result::Result<bytes::bytes::Bytes, http::status::StatusCode> as std::ops::Try>::Ok, <std::result::Result<bytes::bytes::Bytes, http::status::StatusCode> as std::ops::Try>::Error> {<std::result::Result<bytes::bytes::Bytes, http::status::StatusCode> as std::ops::Try>::into_result}, impl futures::future::Future, tokio_async_await::compat::forward::Compat<impl futures::future::Future>, bytes::bytes::Bytes, imagedb::Image<ImageMetadata>, std::sync::Arc<std::sync::Mutex<imagedb::ImageDb<ImageMetadata, imagedb::FileStorage<ImageMetadata>>>>, std::sync::MutexGuard<'t2, imagedb::ImageDb<ImageMetadata, imagedb::FileStorage<ImageMetadata>>>, ImageMetadata, impl futures::future::Future, tokio_async_await::compat::forward::Compat<impl futures::future::Future>}`
- = note: required because it appears within the type `[static generator@src\main.rs:168:29: 238:2 req:http::request::Request<hyper::body::body::Body>, telegram_client:std::sync::Arc<telegram_client::TelegramClient>, dbs:std::sync::Arc<std::sync::Mutex<std::collections::HashMap<i64, std::sync::Arc<std::sync::Mutex<imagedb::ImageDb<ImageMetadata, imagedb::FileStorage<ImageMetadata>>>>>>> for<'r, 's, 't0, 't1, 't2> {fn(std::result::Result<hyper::body::chunk::Chunk, http::status::StatusCode>) -> std::result::Result<<std::result::Result<hyper::body::chunk::Chunk, http::status::StatusCode> as std::ops::Try>::Ok, <std::result::Result<hyper::body::chunk::Chunk, http::status::StatusCode> as std::ops::Try>::Error> {<std::result::Result<hyper::body::chunk::Chunk, http::status::StatusCode> as std::ops::Try>::into_result}, futures::stream::concat::Concat2<hyper::body::body::Body>, tokio_async_await::compat::forward::Compat<futures::stream::concat::Concat2<hyper::body::body::Body>>, (), hyper::body::chunk::Chunk, contract::Update, i64, std::option::Option<(&'r contract::User, &'s std::string::String)>, &'t0 contract::User, &'t1 std::string::String, fn(std::result::Result<contract::File, http::status::StatusCode>) -> std::result::Result<<std::result::Result<contract::File, http::status::StatusCode> as std::ops::Try>::Ok, <std::result::Result<contract::File, http::status::StatusCode> as std::ops::Try>::Error> {<std::result::Result<contract::File, http::status::StatusCode> as std::ops::Try>::into_result}, impl futures::future::Future, tokio_async_await::compat::forward::Compat<impl futures::future::Future>, contract::File, std::string::String, fn(std::result::Result<bytes::bytes::Bytes, http::status::StatusCode>) -> std::result::Result<<std::result::Result<bytes::bytes::Bytes, http::status::StatusCode> as std::ops::Try>::Ok, <std::result::Result<bytes::bytes::Bytes, http::status::StatusCode> as std::ops::Try>::Error> {<std::result::Result<bytes::bytes::Bytes, http::status::StatusCode> as std::ops::Try>::into_result}, impl futures::future::Future, tokio_async_await::compat::forward::Compat<impl futures::future::Future>, bytes::bytes::Bytes, imagedb::Image<ImageMetadata>, std::sync::Arc<std::sync::Mutex<imagedb::ImageDb<ImageMetadata, imagedb::FileStorage<ImageMetadata>>>>, std::sync::MutexGuard<'t2, imagedb::ImageDb<ImageMetadata, imagedb::FileStorage<ImageMetadata>>>, ImageMetadata, impl futures::future::Future, tokio_async_await::compat::forward::Compat<impl futures::future::Future>}]`
- = note: required because it appears within the type `std::future::GenFuture<[static generator@src\main.rs:168:29: 238:2 req:http::request::Request<hyper::body::body::Body>, telegram_client:std::sync::Arc<telegram_client::TelegramClient>, dbs:std::sync::Arc<std::sync::Mutex<std::collections::HashMap<i64, std::sync::Arc<std::sync::Mutex<imagedb::ImageDb<ImageMetadata, imagedb::FileStorage<ImageMetadata>>>>>>> for<'r, 's, 't0, 't1, 't2> {fn(std::result::Result<hyper::body::chunk::Chunk, http::status::StatusCode>) -> std::result::Result<<std::result::Result<hyper::body::chunk::Chunk, http::status::StatusCode> as std::ops::Try>::Ok, <std::result::Result<hyper::body::chunk::Chunk, http::status::StatusCode> as std::ops::Try>::Error> {<std::result::Result<hyper::body::chunk::Chunk, http::status::StatusCode> as std::ops::Try>::into_result}, futures::stream::concat::Concat2<hyper::body::body::Body>, tokio_async_await::compat::forward::Compat<futures::stream::concat::Concat2<hyper::body::body::Body>>, (), hyper::body::chunk::Chunk, contract::Update, i64, std::option::Option<(&'r contract::User, &'s std::string::String)>, &'t0 contract::User, &'t1 std::string::String, fn(std::result::Result<contract::File, http::status::StatusCode>) -> std::result::Result<<std::result::Result<contract::File, http::status::StatusCode> as std::ops::Try>::Ok, <std::result::Result<contract::File, http::status::StatusCode> as std::ops::Try>::Error> {<std::result::Result<contract::File, http::status::StatusCode> as std::ops::Try>::into_result}, impl futures::future::Future, tokio_async_await::compat::forward::Compat<impl futures::future::Future>, contract::File, std::string::String, fn(std::result::Result<bytes::bytes::Bytes, http::status::StatusCode>) -> std::result::Result<<std::result::Result<bytes::bytes::Bytes, http::status::StatusCode> as std::ops::Try>::Ok, <std::result::Result<bytes::bytes::Bytes, http::status::StatusCode> as std::ops::Try>::Error> {<std::result::Result<bytes::bytes::Bytes, http::status::StatusCode> as std::ops::Try>::into_result}, impl futures::future::Future, tokio_async_await::compat::forward::Compat<impl futures::future::Future>, bytes::bytes::Bytes, imagedb::Image<ImageMetadata>, std::sync::Arc<std::sync::Mutex<imagedb::ImageDb<ImageMetadata, imagedb::FileStorage<ImageMetadata>>>>, std::sync::MutexGuard<'t2, imagedb::ImageDb<ImageMetadata, imagedb::FileStorage<ImageMetadata>>>, ImageMetadata, impl futures::future::Future, tokio_async_await::compat::forward::Compat<impl futures::future::Future>}]>`
- = note: required because it appears within the type `impl std::future::Future`
- = note: required because it appears within the type `impl std::future::Future`
- = note: required because it appears within the type `{impl std::future::Future, ()}`
- = note: required because it appears within the type `[static generator@src\main.rs:141:43: 151:2 req:http::request::Request<hyper::body::body::Body>, telegram_client:std::sync::Arc<telegram_client::TelegramClient>, dbs:std::sync::Arc<std::sync::Mutex<std::collections::HashMap<i64, std::sync::Arc<std::sync::Mutex<imagedb::ImageDb<ImageMetadata, imagedb::FileStorage<ImageMetadata>>>>>>> {impl std::future::Future, ()}]`
- = note: required because it appears within the type `std::future::GenFuture<[static generator@src\main.rs:141:43: 151:2 req:http::request::Request<hyper::body::body::Body>, telegram_client:std::sync::Arc<telegram_client::TelegramClient>, dbs:std::sync::Arc<std::sync::Mutex<std::collections::HashMap<i64, std::sync::Arc<std::sync::Mutex<imagedb::ImageDb<ImageMetadata, imagedb::FileStorage<ImageMetadata>>>>>>> {impl std::future::Future, ()}]>`
- = note: required because it appears within the type `impl std::future::Future`
- = note: required because it appears within the type `impl std::future::Future`
- = note: required because of the requirements on the impl of `std::marker::Send` for `std::ptr::Unique<impl std::future::Future>`
- = note: required because it appears within the type `std::boxed::Box<impl std::future::Future>`
- = note: required because it appears within the type `std::pin::Pin<std::boxed::Box<impl std::future::Future>>`
- = note: required because it appears within the type `tokio_async_await::compat::backward::Compat<impl std::future::Future>`
- = note: required because it appears within the type `hyper::proto::h2::server::H2StreamState<tokio_async_await::compat::backward::Compat<impl std::future::Future>, hyper::body::body::Body>`
- = note: required because it appears within the type `hyper::proto::h2::server::H2Stream<tokio_async_await::compat::backward::Compat<impl std::future::Future>, hyper::body::body::Body>`
- = note: required because of the requirements on the impl of `hyper::common::exec::H2Exec<tokio_async_await::compat::backward::Compat<impl std::future::Future>, hyper::body::body::Body>` for `hyper::common::exec::Exec`
- error[E0277]: `std::sync::MutexGuard<'_, imagedb::ImageDb<ImageMetadata, imagedb::FileStorage<ImageMetadata>>>` cannot be sent between threads safely
- --> src\main.rs:125:10
- |
- 125 | .serve(move || {
- | ^^^^^ `std::sync::MutexGuard<'_, imagedb::ImageDb<ImageMetadata, imagedb::FileStorage<ImageMetadata>>>` cannot be sent between threads safely
- |
- = help: within `impl std::future::Future`, the trait `for<'r> std::marker::Send` is not implemented for `std::sync::MutexGuard<'_, imagedb::ImageDb<ImageMetadata, imagedb::FileStorage<ImageMetadata>>>`
- = note: required because it appears within the type `for<'r, 's, 't0, 't1, 't2> {fn(std::result::Result<hyper::body::chunk::Chunk, http::status::StatusCode>) -> std::result::Result<<std::result::Result<hyper::body::chunk::Chunk, http::status::StatusCode> as std::ops::Try>::Ok, <std::result::Result<hyper::body::chunk::Chunk, http::status::StatusCode> as std::ops::Try>::Error> {<std::result::Result<hyper::body::chunk::Chunk, http::status::StatusCode> as std::ops::Try>::into_result}, futures::stream::concat::Concat2<hyper::body::body::Body>, tokio_async_await::compat::forward::Compat<futures::stream::concat::Concat2<hyper::body::body::Body>>, (), hyper::body::chunk::Chunk, contract::Update, i64, std::option::Option<(&'r contract::User, &'s std::string::String)>, &'t0 contract::User, &'t1 std::string::String, fn(std::result::Result<contract::File, http::status::StatusCode>) -> std::result::Result<<std::result::Result<contract::File, http::status::StatusCode> as std::ops::Try>::Ok, <std::result::Result<contract::File, http::status::StatusCode> as std::ops::Try>::Error> {<std::result::Result<contract::File, http::status::StatusCode> as std::ops::Try>::into_result}, impl futures::future::Future, tokio_async_await::compat::forward::Compat<impl futures::future::Future>, contract::File, std::string::String, fn(std::result::Result<bytes::bytes::Bytes, http::status::StatusCode>) -> std::result::Result<<std::result::Result<bytes::bytes::Bytes, http::status::StatusCode> as std::ops::Try>::Ok, <std::result::Result<bytes::bytes::Bytes, http::status::StatusCode> as std::ops::Try>::Error> {<std::result::Result<bytes::bytes::Bytes, http::status::StatusCode> as std::ops::Try>::into_result}, impl futures::future::Future, tokio_async_await::compat::forward::Compat<impl futures::future::Future>, bytes::bytes::Bytes, imagedb::Image<ImageMetadata>, std::sync::Arc<std::sync::Mutex<imagedb::ImageDb<ImageMetadata, imagedb::FileStorage<ImageMetadata>>>>, std::sync::MutexGuard<'t2, imagedb::ImageDb<ImageMetadata, imagedb::FileStorage<ImageMetadata>>>, ImageMetadata, impl futures::future::Future, tokio_async_await::compat::forward::Compat<impl futures::future::Future>}`
- = note: required because it appears within the type `[static generator@src\main.rs:168:29: 238:2 req:http::request::Request<hyper::body::body::Body>, telegram_client:std::sync::Arc<telegram_client::TelegramClient>, dbs:std::sync::Arc<std::sync::Mutex<std::collections::HashMap<i64, std::sync::Arc<std::sync::Mutex<imagedb::ImageDb<ImageMetadata, imagedb::FileStorage<ImageMetadata>>>>>>> for<'r, 's, 't0, 't1, 't2> {fn(std::result::Result<hyper::body::chunk::Chunk, http::status::StatusCode>) -> std::result::Result<<std::result::Result<hyper::body::chunk::Chunk, http::status::StatusCode> as std::ops::Try>::Ok, <std::result::Result<hyper::body::chunk::Chunk, http::status::StatusCode> as std::ops::Try>::Error> {<std::result::Result<hyper::body::chunk::Chunk, http::status::StatusCode> as std::ops::Try>::into_result}, futures::stream::concat::Concat2<hyper::body::body::Body>, tokio_async_await::compat::forward::Compat<futures::stream::concat::Concat2<hyper::body::body::Body>>, (), hyper::body::chunk::Chunk, contract::Update, i64, std::option::Option<(&'r contract::User, &'s std::string::String)>, &'t0 contract::User, &'t1 std::string::String, fn(std::result::Result<contract::File, http::status::StatusCode>) -> std::result::Result<<std::result::Result<contract::File, http::status::StatusCode> as std::ops::Try>::Ok, <std::result::Result<contract::File, http::status::StatusCode> as std::ops::Try>::Error> {<std::result::Result<contract::File, http::status::StatusCode> as std::ops::Try>::into_result}, impl futures::future::Future, tokio_async_await::compat::forward::Compat<impl futures::future::Future>, contract::File, std::string::String, fn(std::result::Result<bytes::bytes::Bytes, http::status::StatusCode>) -> std::result::Result<<std::result::Result<bytes::bytes::Bytes, http::status::StatusCode> as std::ops::Try>::Ok, <std::result::Result<bytes::bytes::Bytes, http::status::StatusCode> as std::ops::Try>::Error> {<std::result::Result<bytes::bytes::Bytes, http::status::StatusCode> as std::ops::Try>::into_result}, impl futures::future::Future, tokio_async_await::compat::forward::Compat<impl futures::future::Future>, bytes::bytes::Bytes, imagedb::Image<ImageMetadata>, std::sync::Arc<std::sync::Mutex<imagedb::ImageDb<ImageMetadata, imagedb::FileStorage<ImageMetadata>>>>, std::sync::MutexGuard<'t2, imagedb::ImageDb<ImageMetadata, imagedb::FileStorage<ImageMetadata>>>, ImageMetadata, impl futures::future::Future, tokio_async_await::compat::forward::Compat<impl futures::future::Future>}]`
- = note: required because it appears within the type `std::future::GenFuture<[static generator@src\main.rs:168:29: 238:2 req:http::request::Request<hyper::body::body::Body>, telegram_client:std::sync::Arc<telegram_client::TelegramClient>, dbs:std::sync::Arc<std::sync::Mutex<std::collections::HashMap<i64, std::sync::Arc<std::sync::Mutex<imagedb::ImageDb<ImageMetadata, imagedb::FileStorage<ImageMetadata>>>>>>> for<'r, 's, 't0, 't1, 't2> {fn(std::result::Result<hyper::body::chunk::Chunk, http::status::StatusCode>) -> std::result::Result<<std::result::Result<hyper::body::chunk::Chunk, http::status::StatusCode> as std::ops::Try>::Ok, <std::result::Result<hyper::body::chunk::Chunk, http::status::StatusCode> as std::ops::Try>::Error> {<std::result::Result<hyper::body::chunk::Chunk, http::status::StatusCode> as std::ops::Try>::into_result}, futures::stream::concat::Concat2<hyper::body::body::Body>, tokio_async_await::compat::forward::Compat<futures::stream::concat::Concat2<hyper::body::body::Body>>, (), hyper::body::chunk::Chunk, contract::Update, i64, std::option::Option<(&'r contract::User, &'s std::string::String)>, &'t0 contract::User, &'t1 std::string::String, fn(std::result::Result<contract::File, http::status::StatusCode>) -> std::result::Result<<std::result::Result<contract::File, http::status::StatusCode> as std::ops::Try>::Ok, <std::result::Result<contract::File, http::status::StatusCode> as std::ops::Try>::Error> {<std::result::Result<contract::File, http::status::StatusCode> as std::ops::Try>::into_result}, impl futures::future::Future, tokio_async_await::compat::forward::Compat<impl futures::future::Future>, contract::File, std::string::String, fn(std::result::Result<bytes::bytes::Bytes, http::status::StatusCode>) -> std::result::Result<<std::result::Result<bytes::bytes::Bytes, http::status::StatusCode> as std::ops::Try>::Ok, <std::result::Result<bytes::bytes::Bytes, http::status::StatusCode> as std::ops::Try>::Error> {<std::result::Result<bytes::bytes::Bytes, http::status::StatusCode> as std::ops::Try>::into_result}, impl futures::future::Future, tokio_async_await::compat::forward::Compat<impl futures::future::Future>, bytes::bytes::Bytes, imagedb::Image<ImageMetadata>, std::sync::Arc<std::sync::Mutex<imagedb::ImageDb<ImageMetadata, imagedb::FileStorage<ImageMetadata>>>>, std::sync::MutexGuard<'t2, imagedb::ImageDb<ImageMetadata, imagedb::FileStorage<ImageMetadata>>>, ImageMetadata, impl futures::future::Future, tokio_async_await::compat::forward::Compat<impl futures::future::Future>}]>`
- = note: required because it appears within the type `impl std::future::Future`
- = note: required because it appears within the type `impl std::future::Future`
- = note: required because it appears within the type `{impl std::future::Future, ()}`
- = note: required because it appears within the type `[static generator@src\main.rs:141:43: 151:2 req:http::request::Request<hyper::body::body::Body>, telegram_client:std::sync::Arc<telegram_client::TelegramClient>, dbs:std::sync::Arc<std::sync::Mutex<std::collections::HashMap<i64, std::sync::Arc<std::sync::Mutex<imagedb::ImageDb<ImageMetadata, imagedb::FileStorage<ImageMetadata>>>>>>> {impl std::future::Future, ()}]`
- = note: required because it appears within the type `std::future::GenFuture<[static generator@src\main.rs:141:43: 151:2 req:http::request::Request<hyper::body::body::Body>, telegram_client:std::sync::Arc<telegram_client::TelegramClient>, dbs:std::sync::Arc<std::sync::Mutex<std::collections::HashMap<i64, std::sync::Arc<std::sync::Mutex<imagedb::ImageDb<ImageMetadata, imagedb::FileStorage<ImageMetadata>>>>>>> {impl std::future::Future, ()}]>`
- = note: required because it appears within the type `impl std::future::Future`
- = note: required because it appears within the type `impl std::future::Future`
- = note: required because of the requirements on the impl of `std::marker::Send` for `std::ptr::Unique<impl std::future::Future>`
- = note: required because it appears within the type `std::boxed::Box<impl std::future::Future>`
- = note: required because it appears within the type `std::pin::Pin<std::boxed::Box<impl std::future::Future>>`
- = note: required because it appears within the type `tokio_async_await::compat::backward::Compat<impl std::future::Future>`
- = note: required because it appears within the type `hyper::proto::h2::server::H2StreamState<tokio_async_await::compat::backward::Compat<impl std::future::Future>, hyper::body::body::Body>`
- = note: required because it appears within the type `hyper::proto::h2::server::H2Stream<tokio_async_await::compat::backward::Compat<impl std::future::Future>, hyper::body::body::Body>`
- = note: required because of the requirements on the impl of `hyper::common::exec::H2Exec<tokio_async_await::compat::backward::Compat<impl std::future::Future>, hyper::body::body::Body>` for `hyper::common::exec::Exec`
- error[E0599]: no method named `map_err` found for type `hyper::server::Server<hyper::server::tcp::AddrIncoming, [closure@src\main.rs:125:16: 130:10 telegram_client:_, dbs:_]>` in the current scope
- --> src\main.rs:131:10
- |
- 131 | .map_err(|e| error!("server error: {}", e));
- | ^^^^^^^
- |
- = note: the method `map_err` exists but the following trait bounds were not satisfied:
- `hyper::server::Server<hyper::server::tcp::AddrIncoming, [closure@src\main.rs:125:16: 130:10 telegram_client:_, dbs:_]> : futures::future::Future`
- `&mut hyper::server::Server<hyper::server::tcp::AddrIncoming, [closure@src\main.rs:125:16: 130:10 telegram_client:_, dbs:_]> : futures::stream::Stream`
- `&mut hyper::server::Server<hyper::server::tcp::AddrIncoming, [closure@src\main.rs:125:16: 130:10 telegram_client:_, dbs:_]> : futures::future::Future`
- error[E0599]: no method named `map_err` found for type `hyper::server::Server<hyper::server::tcp::AddrIncoming, [closure@src\main.rs:125:16: 130:10 telegram_client:_, dbs:_]>` in the current scope
- --> src\main.rs:131:10
- |
- 131 | .map_err(|e| error!("server error: {}", e));
- | ^^^^^^^
- |
- = note: the method `map_err` exists but the following trait bounds were not satisfied:
- `hyper::server::Server<hyper::server::tcp::AddrIncoming, [closure@src\main.rs:125:16: 130:10 telegram_client:_, dbs:_]> : futures::future::Future`
- `&mut hyper::server::Server<hyper::server::tcp::AddrIncoming, [closure@src\main.rs:125:16: 130:10 telegram_client:_, dbs:_]> : futures::future::Future`
- `&mut hyper::server::Server<hyper::server::tcp::AddrIncoming, [closure@src\main.rs:125:16: 130:10 telegram_client:_, dbs:_]> : futures::stream::Stream`
- error: aborting due to 2 previous errors
- Some errors occurred: E0277, E0599.
- For more information about an error, try `rustc --explain E0277`.
- error: aborting due to 2 previous errors
- Some errors occurred: E0277, E0599.
- For more information about an error, try `rustc --explain E0277`.
- error: Could not compile `boyan_detector_bot`.
- warning: build failed, waiting for other jobs to finish...
- error: Could not compile `boyan_detector_bot`.
- To learn more, run the command again with --verbose.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement