Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
see hyperium/tonic#1307 Tonic interceptors require a Default on the body. This makes it easier to use an adapter type tonic. FWIW the default type I am using: ```rust #[derive(Default)] pub enum DefaultIncoming { Some(Incoming), #[default] Empty } impl Body for DefaultIncoming { type Data = Bytes; type Error = hyper::Error; fn poll_frame(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Result<Frame<Self::Data>, Self::Error>>> { match self.get_mut() { DefaultIncoming::Some(ref mut i) => Pin::new(i).poll_frame(cx), DefaultIncoming::Empty => Pin::new(&mut http_body_util::Empty::<Bytes>::new()).poll_frame(cx).map_err(|_| unreachable!()) } } } ```
- Loading branch information