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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thoughts about making UnixStream public #50

Open
Mythra opened this issue Jul 14, 2021 · 3 comments 路 May be fixed by #53 or #60
Open

Thoughts about making UnixStream public #50

Mythra opened this issue Jul 14, 2021 · 3 comments 路 May be fixed by #53 or #60

Comments

@Mythra
Copy link

Mythra commented Jul 14, 2021

馃憢 I'm looking at using this logic as part of my own HTTP Client, and I was hoping to get access to the UnixStream type: https://github.com/softprops/hyperlocal/blob/main/src/client.rs#L19.

The main reason i'm doing this all is to honestly have hyper tuned error reporting. Certain IO Error codes mean certain things depending on the stream type, and by wrapping everything in my own custom enums I can make decisions/keep state about the streams, connectors, etc. In any part of my codebase.

I realize most people get fine without it though, and I imagine it was made private for a reason, so I just wanted to see if there was any chance we could start exporting that type.

fnichol added a commit to fnichol/hyperlocal that referenced this issue Oct 21, 2021
Resolves softprops#50

Signed-off-by: Fletcher Nichol <fnichol@nichol.ca>
@fnichol fnichol linked a pull request Oct 21, 2021 that will close this issue
@onalante-msft
Copy link
Contributor

onalante-msft commented Jan 11, 2022

The choice to keep the inner UnixStream private seems to match what hyper does with AddrStream: reference. Though the latter type does have an into_inner to get the backing TcpStream, it would not be usable in a MakeServiceRef implementor. Your application could certainly be doing something else... Is this a capability that you are currently using with AddrStream (or similar)? UnixStream could probably implement into_inner, if so.

@fnichol Just in case.

yu-re-ka pushed a commit to yu-re-ka/hyperlocal that referenced this issue Jul 3, 2022
Resolves softprops#50

Signed-off-by: Fletcher Nichol <fnichol@nichol.ca>
@yu-re-ka
Copy link

yu-re-ka commented Jul 4, 2022

hyper does not expose the inner TcpStream, but the AddrStream itself is exposed in the public interface?
For my use case, I wrap UnixConnector and UnixStream into my own enum types together with other connectors / streams. I would think it is quite common to support both unix and other uris in one hyper client?

@onalante-msft
Copy link
Contributor

Oh, I completely missed that UnixStream was not exported from lib.rs. My sincere apologies about that! I should have looked more closely at the export declarations.

I agree that making UnixStream public would be most consistent with hyper.

@softprops Would you like to delegate maintenance of this project to help manage some of the outstanding PRs?

onalante-msft pushed a commit to onalante-msft/hyperlocal that referenced this issue Aug 13, 2022
Resolves softprops#50

Signed-off-by: Fletcher Nichol <fnichol@nichol.ca>
@onalante-msft onalante-msft linked a pull request Aug 13, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants