Skip to content

Instantly share code, notes, and snippets.

@Gastove
Created October 29, 2021 22:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gastove/5ee36e22b0d5360c1ed079829096eec0 to your computer and use it in GitHub Desktop.
Save Gastove/5ee36e22b0d5360c1ed079829096eec0 to your computer and use it in GitHub Desktop.
Compiling voltron-grpc v0.1.0 (/home/rdonaldson/Code/DB/voltron/code/rust)
error[E0277]: the trait bound `impl Future: VoltronCache` is not satisfied
--> src/bin/server.rs:17:46
|
17 | .add_service(VoltronCacheServer::new(server))
| ^^^^^^ the trait `VoltronCache` is not implemented for `impl Future`
|
note: required by `VoltronCacheServer::<T>::new`
--> /home/rdonaldson/Code/DB/voltron/code/rust/target/debug/build/voltron-grpc-ae3836ff64840844/out/voltron.rs:191:9
|
191 | pub fn new(inner: T) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the trait bound `impl Future: VoltronCache` is not satisfied
--> src/bin/server.rs:17:22
|
17 | .add_service(VoltronCacheServer::new(server))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `VoltronCache` is not implemented for `impl Future`
|
note: required by a bound in `VoltronCacheServer`
--> /home/rdonaldson/Code/DB/voltron/code/rust/target/debug/build/voltron-grpc-ae3836ff64840844/out/voltron.rs:184:38
|
184 | pub struct VoltronCacheServer<T: VoltronCache> {
| ^^^^^^^^^^^^ required by this bound in `VoltronCacheServer`
error[E0277]: `dyn Future<Output = Result<redis::aio::Connection, redis::types::RedisError>> + Send` cannot be shared between threads safely
--> src/bin/server.rs:17:10
|
17 | .add_service(VoltronCacheServer::new(server))
| ^^^^^^^^^^^ `dyn Future<Output = Result<redis::aio::Connection, redis::types::RedisError>> + Send` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `dyn Future<Output = Result<redis::aio::Connection, redis::types::RedisError>> + Send`
= note: required because of the requirements on the impl of `Sync` for `Unique<dyn Future<Output = Result<redis::aio::Connection, redis::types::RedisError>> + Send>`
= note: required because it appears within the type `Box<dyn Future<Output = Result<redis::aio::Connection, redis::types::RedisError>> + Send>`
= note: required because it appears within the type `Pin<Box<dyn Future<Output = Result<redis::aio::Connection, redis::types::RedisError>> + Send>>`
= note: required because it appears within the type `for<'r, 's, 't0, 't1, 't2, 't3, 't4, 't5, 't6, 't7, 't8, 't9, 't10, 't11> {ResumeTy, &'r bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>, bb8::internals::Approval, std::sync::Weak<bb8::internals::SharedPool<bb8_redis::RedisConnectionManager>>, Arc<bb8::internals::SharedPool<bb8_redis::RedisConnectionManager>>, std::time::Instant, Duration, bb8::internals::SharedPool<bb8_redis::RedisConnectionManager>, &'s bb8_redis::RedisConnectionManager, bb8_redis::RedisConnectionManager, Pin<Box<(dyn Future<Output = Result<redis::aio::Connection, redis::types::RedisError>> + Send + 't0)>>, [closure@bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>::add_connection::{closure#0}::{closure#0}], futures_util::future::try_future::AndThen<Pin<Box<(dyn Future<Output = Result<redis::aio::Connection, redis::types::RedisError>> + Send + 't5)>>, impl for<'t6, 't7> Future, [closure@bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>::add_connection::{closure#0}::{closure#0}]>, (), Result<redis::aio::Connection, redis::types::RedisError>, redis::types::RedisError, bool, Sleep}`
= note: required because it appears within the type `[static generator@bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>::add_connection::{closure#0}]`
= note: required because it appears within the type `from_generator::GenFuture<[static generator@bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>::add_connection::{closure#0}]>`
= note: required because it appears within the type `impl Future`
= note: required because it appears within the type `impl Future`
= note: required because it appears within the type `for<'r, 's> {ResumeTy, &'r bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>, bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>, bb8::internals::Approval, impl for<'s> Future, ()}`
= note: required because it appears within the type `[static generator@bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>::replenish_idle_connections::{closure#0}]`
= note: required because it appears within the type `from_generator::GenFuture<[static generator@bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>::replenish_idle_connections::{closure#0}]>`
= note: required because it appears within the type `impl Future`
= note: required because it appears within the type `impl Future`
= note: required because of the requirements on the impl of `Sync` for `futures_util::stream::futures_unordered::FuturesUnordered<impl Future>`
= note: required because it appears within the type `for<'r, 's, 't0> {ResumeTy, &'r bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>, bb8::internals::ApprovalIter, futures_util::stream::futures_unordered::FuturesUnordered<impl Future>, &'s mut futures_util::stream::futures_unordered::FuturesUnordered<impl Future>, futures_util::stream::stream::next::Next<'t0, futures_util::stream::futures_unordered::FuturesUnordered<impl Future>>, ()}`
= note: required because it appears within the type `[static generator@bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>::start_connections::{closure#0}]`
= note: required because it appears within the type `from_generator::GenFuture<[static generator@bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>::start_connections::{closure#0}]>`
= note: required because it appears within the type `impl Future`
= note: required because it appears within the type `impl Future`
= note: required because it appears within the type `for<'r, 's> {ResumeTy, bb8::api::Builder<bb8_redis::RedisConnectionManager>, bb8_redis::RedisConnectionManager, bb8::api::Pool<bb8_redis::RedisConnectionManager>, &'r bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>, bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>, impl for<'s> Future, ()}`
= note: required because it appears within the type `[static generator@bb8::api::Builder<bb8_redis::RedisConnectionManager>::build::{closure#0}]`
= note: required because it appears within the type `from_generator::GenFuture<[static generator@bb8::api::Builder<bb8_redis::RedisConnectionManager>::build::{closure#0}]>`
= note: required because it appears within the type `impl Future`
= note: required because it appears within the type `impl Future`
= note: required because it appears within the type `{ResumeTy, bb8_redis::RedisConnectionManager, u32, impl Future, ()}`
= note: required because it appears within the type `[static generator@CacheServer::new::{closure#0}]`
= note: required because it appears within the type `from_generator::GenFuture<[static generator@CacheServer::new::{closure#0}]>`
= note: required because it appears within the type `impl Future`
= note: required because it appears within the type `impl Future`
= note: required because of the requirements on the impl of `Send` for `Arc<impl Future>`
= note: required because it appears within the type `voltron_cache_server::_Inner<impl Future>`
= note: required because it appears within the type `VoltronCacheServer<impl Future>`
error[E0277]: `dyn Future<Output = Result<(), redis::types::RedisError>> + Send` cannot be shared between threads safely
--> src/bin/server.rs:17:10
|
17 | .add_service(VoltronCacheServer::new(server))
| ^^^^^^^^^^^ `dyn Future<Output = Result<(), redis::types::RedisError>> + Send` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `dyn Future<Output = Result<(), redis::types::RedisError>> + Send`
= note: required because of the requirements on the impl of `Sync` for `Unique<dyn Future<Output = Result<(), redis::types::RedisError>> + Send>`
= note: required because it appears within the type `Box<dyn Future<Output = Result<(), redis::types::RedisError>> + Send>`
= note: required because it appears within the type `Pin<Box<dyn Future<Output = Result<(), redis::types::RedisError>> + Send>>`
= note: required because it appears within the type `for<'r, 's, 't0, 't1, 't2, 't3, 't4, 't5, 't6, 't7, 't8, 't9> {ResumeTy, &'r bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>, &'s mut redis::aio::Connection, bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>, bb8::internals::SharedPool<bb8_redis::RedisConnectionManager>, Arc<bb8::internals::SharedPool<bb8_redis::RedisConnectionManager>>, bb8::api::Builder<bb8_redis::RedisConnectionManager>, &'t0 Option<Box<(dyn bb8::api::CustomizeConnection<redis::aio::Connection, redis::types::RedisError> + 't1)>>, Option<Box<(dyn bb8::api::CustomizeConnection<redis::aio::Connection, redis::types::RedisError> + 't2)>>, Option<&'t3 Box<(dyn bb8::api::CustomizeConnection<redis::aio::Connection, redis::types::RedisError> + 't4)>>, &'t5 Box<(dyn bb8::api::CustomizeConnection<redis::aio::Connection, redis::types::RedisError> + 't6)>, &'t7 (dyn bb8::api::CustomizeConnection<redis::aio::Connection, redis::types::RedisError> + 't8), Pin<Box<(dyn Future<Output = Result<(), redis::types::RedisError>> + Send + 't9)>>, ()}`
= note: required because it appears within the type `[static generator@bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>::on_acquire_connection::{closure#0}]`
= note: required because it appears within the type `from_generator::GenFuture<[static generator@bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>::on_acquire_connection::{closure#0}]>`
= note: required because it appears within the type `impl Future`
= note: required because it appears within the type `impl Future`
= note: required because it appears within the type `for<'r, 's, 't0, 't1> {ResumeTy, &'r bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>, redis::aio::Connection, &'s mut redis::aio::Connection, impl for<'t0, 't1> Future, ()}`
= note: required because it appears within the type `[static generator@bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>::add_connection::{closure#0}::{closure#0}::{closure#0}]`
= note: required because it appears within the type `from_generator::GenFuture<[static generator@bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>::add_connection::{closure#0}::{closure#0}::{closure#0}]>`
= note: required because it appears within the type `impl Future`
= note: required because it appears within the type `futures_util::future::try_future::try_flatten::TryFlatten<futures_util::future::try_future::MapOk<Pin<Box<dyn Future<Output = Result<redis::aio::Connection, redis::types::RedisError>> + Send>>, [closure@bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>::add_connection::{closure#0}::{closure#0}]>, impl Future>`
= note: required because it appears within the type `futures_util::future::try_future::TryFlatten<futures_util::future::try_future::MapOk<Pin<Box<dyn Future<Output = Result<redis::aio::Connection, redis::types::RedisError>> + Send>>, [closure@bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>::add_connection::{closure#0}::{closure#0}]>, impl Future>`
= note: required because it appears within the type `futures_util::future::try_future::AndThen<Pin<Box<dyn Future<Output = Result<redis::aio::Connection, redis::types::RedisError>> + Send>>, impl Future, [closure@bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>::add_connection::{closure#0}::{closure#0}]>`
= note: required because it appears within the type `for<'r, 's, 't0, 't1, 't2, 't3, 't4, 't5, 't6, 't7, 't8, 't9, 't10, 't11> {ResumeTy, &'r bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>, bb8::internals::Approval, std::sync::Weak<bb8::internals::SharedPool<bb8_redis::RedisConnectionManager>>, Arc<bb8::internals::SharedPool<bb8_redis::RedisConnectionManager>>, std::time::Instant, Duration, bb8::internals::SharedPool<bb8_redis::RedisConnectionManager>, &'s bb8_redis::RedisConnectionManager, bb8_redis::RedisConnectionManager, Pin<Box<(dyn Future<Output = Result<redis::aio::Connection, redis::types::RedisError>> + Send + 't0)>>, [closure@bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>::add_connection::{closure#0}::{closure#0}], futures_util::future::try_future::AndThen<Pin<Box<(dyn Future<Output = Result<redis::aio::Connection, redis::types::RedisError>> + Send + 't5)>>, impl for<'t6, 't7> Future, [closure@bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>::add_connection::{closure#0}::{closure#0}]>, (), Result<redis::aio::Connection, redis::types::RedisError>, redis::types::RedisError, bool, Sleep}`
= note: required because it appears within the type `[static generator@bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>::add_connection::{closure#0}]`
= note: required because it appears within the type `from_generator::GenFuture<[static generator@bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>::add_connection::{closure#0}]>`
= note: required because it appears within the type `impl Future`
= note: required because it appears within the type `impl Future`
= note: required because it appears within the type `for<'r, 's> {ResumeTy, &'r bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>, bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>, bb8::internals::Approval, impl for<'s> Future, ()}`
= note: required because it appears within the type `[static generator@bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>::replenish_idle_connections::{closure#0}]`
= note: required because it appears within the type `from_generator::GenFuture<[static generator@bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>::replenish_idle_connections::{closure#0}]>`
= note: required because it appears within the type `impl Future`
= note: required because it appears within the type `impl Future`
= note: required because of the requirements on the impl of `Sync` for `futures_util::stream::futures_unordered::FuturesUnordered<impl Future>`
= note: required because it appears within the type `for<'r, 's, 't0> {ResumeTy, &'r bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>, bb8::internals::ApprovalIter, futures_util::stream::futures_unordered::FuturesUnordered<impl Future>, &'s mut futures_util::stream::futures_unordered::FuturesUnordered<impl Future>, futures_util::stream::stream::next::Next<'t0, futures_util::stream::futures_unordered::FuturesUnordered<impl Future>>, ()}`
= note: required because it appears within the type `[static generator@bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>::start_connections::{closure#0}]`
= note: required because it appears within the type `from_generator::GenFuture<[static generator@bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>::start_connections::{closure#0}]>`
= note: required because it appears within the type `impl Future`
= note: required because it appears within the type `impl Future`
= note: required because it appears within the type `for<'r, 's> {ResumeTy, bb8::api::Builder<bb8_redis::RedisConnectionManager>, bb8_redis::RedisConnectionManager, bb8::api::Pool<bb8_redis::RedisConnectionManager>, &'r bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>, bb8::inner::PoolInner<bb8_redis::RedisConnectionManager>, impl for<'s> Future, ()}`
= note: required because it appears within the type `[static generator@bb8::api::Builder<bb8_redis::RedisConnectionManager>::build::{closure#0}]`
= note: required because it appears within the type `from_generator::GenFuture<[static generator@bb8::api::Builder<bb8_redis::RedisConnectionManager>::build::{closure#0}]>`
= note: required because it appears within the type `impl Future`
= note: required because it appears within the type `impl Future`
= note: required because it appears within the type `{ResumeTy, bb8_redis::RedisConnectionManager, u32, impl Future, ()}`
= note: required because it appears within the type `[static generator@CacheServer::new::{closure#0}]`
= note: required because it appears within the type `from_generator::GenFuture<[static generator@CacheServer::new::{closure#0}]>`
= note: required because it appears within the type `impl Future`
= note: required because it appears within the type `impl Future`
= note: required because of the requirements on the impl of `Send` for `Arc<impl Future>`
= note: required because it appears within the type `voltron_cache_server::_Inner<impl Future>`
= note: required because it appears within the type `VoltronCacheServer<impl Future>`
error[E0599]: the method `serve` exists for struct `Router<VoltronCacheServer<impl Future>, tonic::transport::server::Unimplemented>`, but its trait bounds were not satisfied
--> src/bin/server.rs:18:10
|
18 | .serve(addr)
| ^^^^^ method cannot be called on `Router<VoltronCacheServer<impl Future>, tonic::transport::server::Unimplemented>` due to unsatisfied trait bounds
|
::: /home/rdonaldson/Code/DB/voltron/code/rust/target/debug/build/voltron-grpc-ae3836ff64840844/out/voltron.rs:184:5
|
184 | pub struct VoltronCacheServer<T: VoltronCache> {
| ----------------------------------------------
| |
| doesn't satisfy `<_ as Service<tonic::codegen::http::Request<tonic::transport::Body>>>::Response = tonic::codegen::http::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes, Status>>`
| doesn't satisfy `VoltronCacheServer<impl Future>: Clone`
| doesn't satisfy `VoltronCacheServer<impl Future>: Send`
| doesn't satisfy `_: Service<tonic::codegen::http::Request<tonic::transport::Body>>`
|
= note: the following trait bounds were not satisfied:
`<VoltronCacheServer<impl Future> as Service<tonic::codegen::http::Request<tonic::transport::Body>>>::Response = tonic::codegen::http::Response<http_body::combinators::box_body::UnsyncBoxBody<bytes::bytes::Bytes, Status>>`
`VoltronCacheServer<impl Future>: Service<tonic::codegen::http::Request<tonic::transport::Body>>`
`VoltronCacheServer<impl Future>: Clone`
`VoltronCacheServer<impl Future>: Send`
`impl Future: VoltronCache`
Some errors have detailed explanations: E0277, E0599.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `voltron-grpc` due to 5 previous errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment