tokio-rs / tokio

A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...
https://tokio.rs
MIT License
26.59k stars 2.45k forks source link

Derive common traits for NamedPipeInfo struct #6586

Closed Tacklebox closed 4 months ago

Tacklebox commented 4 months ago

Motivation

I would like to use windows named pipes as the transport for GRPC with tonic. That requires that the transport implement Connected, which requires the info struct implement Clone. While a wrapper struct could be used, NamedPipeInfo doesn't seem to have any particular reason not to implement Clone directly.

Solution

Add Clone (And a few other useful traits already derived on the members of NamedPipeInfo) to the derive macro.