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

expose tokio_uds from the root crate #526

Merged
merged 1 commit into from
Aug 16, 2018
Merged

Conversation

casimir
Copy link
Contributor

@casimir casimir commented Aug 7, 2018

This is the start of the work to expose tokio_uds like tokio_tcp and tokio_udp. Just like in the std lib the export is only effective for unix systems.

There is to some points to discuss:

  • I choose to follow the 3-letters convention with uds is that ok?
  • Should there be more symbol exported (e.g. SendDgram, RecvDgram)? If so how to handle name conflict?
  • I couldn't find how to handle the plateform-specific documentation.

@carllerche
Copy link
Member

Thanks for doing this.

I would keep the names used in the sub crate (Unix*) to avoid confusion.

The only other question is if the types should be re-exported in tokio::net directly or a different module. std uses std::os::unix::net::UnixStream but I don't think I would mirror that. I would be fine with just using tokio::net except for the SendDgram RecvDgram conflict...

Here is my proposal, what are your thoughts?

// In `tokio::net`

#[cfg(unix)]
pub mod unix {
    //! Dox

    pub use tokio_uds::*;
}

pub use tokio_uds::{UnixListener, UnixStream};

Eventually, we could add a udp module and move UDP's RecvDgram and SendDgram types into there to avoid polluting tokio::net with types that will rarely be used directly.

@casimir
Copy link
Contributor Author

casimir commented Aug 9, 2018

I like the pattern you propose: 1 module for 1 crate and only the most used symbols in tokio::net for convenience. I updated the PR in consequence (sorry for the force-push I mixed up my git commands). Let me now if something is still missing.

After this PR I can take care of the tcp and udp module if you're still up to this.

Copy link
Member

@carllerche carllerche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

@seanmonstar, you good w/ this layout?

Re: TCP / UDP, I would definitely take a PR. You will just have to make sure to not introduce breaking changes. Instead, hide types from docs & flag the exports as deprecated.

@casimir
Copy link
Contributor Author

casimir commented Aug 12, 2018

Just updated the commit to fix conflicts with master.

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

Successfully merging this pull request may close these issues.

2 participants