I tried to use rx.map(|_| ()), but compiler complains that another trait is not satisfied.
|
57 | _ = grpc_server.serve_with_shutdown(self.addr, rx.map(|_| ())) => {
| ^^^ method cannot be called on `tokio::sync::oneshot::Receiver<()>` due to unsatisfied trait bounds
|
::: /Users/zp/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tokio-1.9.0/src/sync/oneshot.rs:124:1
|
124 | pub struct Receiver<T> {
| ---------------------- doesn't satisfy `tokio::sync::oneshot::Receiver<()>: Iterator`
|
= note: the following trait bounds were not satisfied:
`tokio::sync::oneshot::Receiver<()>: Iterator`
which is required by `&mut tokio::sync::oneshot::Receiver<()>: Iterator`
= help: items from traits can only be used if the trait is in scope
= note: the following trait is implemented but not in scope; perhaps add a `use` for it:
`use futures_util::future::future::FutureExt;`