Visibility of the Stream adaptor structures in tokio-stream #6655
-
The For context, I am playing around with tonic, and need to name the type of the impl MyServiceTrait for MyServiceStructure {
type RpcResponseType = Take<MyStreamType>;
async fn my_fn(&self, request: ...) -> Result<Response<RpcResponseType>, Status> { ... }
} and I can't import |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
We usually do this kind of thing so that we can later use |
Beta Was this translation helpful? Give feedback.
If the type is visible, then you can write code that would not compile if the type stops being
Take<Self>
. Changing it to returnimpl Stream
would count as that.As for whether a change will be made, well, I could probably be convinced to accept a change for this. But I will not make the change myself.