Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move UDS types to unix module #1114

Closed
Thomasdezeeuw opened this issue Oct 29, 2019 · 7 comments
Closed

Move UDS types to unix module #1114

Thomasdezeeuw opened this issue Oct 29, 2019 · 7 comments
Milestone

Comments

@Thomasdezeeuw
Copy link
Collaborator

Currently the UDS types (UnixDatagram, UnixListener, UnixStream) currently live in the net module, but they are Unix only. Shouldn't these live in the unix module (following what std lib does)? Or perhaps in mio::unix::net.

If Windows (or more platforms) ever get support for them we can always moves them, leaving alias in the unix module.

/cc @kleimkuhler

@Thomasdezeeuw Thomasdezeeuw added this to the v0.7 milestone Oct 29, 2019
@DoumanAsh
Copy link

If Windows (or more platforms) ever get support for them we can always moves them, leaving alias in the unix module.

JFYI some newer versions of Win10 supports it

@Thomasdezeeuw
Copy link
Collaborator Author

JFYI some newer versions of Win10 supports it

Good to know, but Mio doesn't (yet) support them.

@kleimkuhler
Copy link
Contributor

I think this would be a good idea. Using UnixListener for example requires std::os::unix::net::UnixListener, so I think mio::unix::net makes the most sense.

@carllerche
Copy link
Member

I believe that keeping platform specific types in separate modules & trait extensions has been considered a "mistake". Instead, types should just be where they make natural sense and use feature flags to enable / disable.

So i would recommend to follow this guidance.

@Thomasdezeeuw
Copy link
Collaborator Author

@carllerche the blog post makes a lot of good points, I'm ok with leaving it the net module. Do you want to the same for SourceFd (and possible future Windows counterpart)? I'm not sure where they would move to though.

Also should more documentation be added that they're Unix only, I know the name suggests it but still. The API in the standard library have a clear blue box, e.g. see https://doc.rust-lang.org/std/os/unix/net/struct.UnixStream.html, but I don't know if that is available for user code yet.

@arsing
Copy link

arsing commented Nov 7, 2019

(UDS support on Windows previously discussed in #880 )

@Thomasdezeeuw
Copy link
Collaborator Author

Not doing this, leaving the UDS types in the net module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants