quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.85k stars 394 forks source link

Re-export udp::{RecvMeta, UdpState} for AsyncUdpSocket #1476

Closed XOR-op closed 1 year ago

XOR-op commented 1 year ago

To implement AsyncUdpSocket Trait from quinn crate, we must use the types RecvMeta and UdpState. However, current version of quinn does not re-export them, so anyone who wants to implement the trait needs importing another quinn-udp crate. This PR fixes this problem by re-export them in quinn crate.

djc commented 1 year ago

Seems okay. Maybe we should expose these as part of a public udp module?

XOR-op commented 1 year ago

Do you mean we should export the whole udp module? That is a good idea since they are all helpful when implementing a custom AsyncUdpSocket, and in fact, there are only 4 structs + 1 constant.

djc commented 1 year ago

I'd prefer not to use a * import, but feel free to export all the items that are useful to you.

XOR-op commented 1 year ago

I finally re-export quinn-udp as a submodule of quinn, which does not mess up the root namespace.