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

Remove dependency on hyper::Body for shio::Response #30

Open
cetra3 opened this issue Sep 27, 2017 · 0 comments
Open

Remove dependency on hyper::Body for shio::Response #30

cetra3 opened this issue Sep 27, 2017 · 0 comments

Comments

@cetra3
Copy link

cetra3 commented Sep 27, 2017

Following from hyperium/hyper#1328

Currently the type signature of the shio::Response is heavily coupled to hyper::Body:

pub struct Response {
    pub inner: hyper::Response<hyper::Body>,
}

And setting the body requires that it can be at least converted into a hyper::Body:

    pub fn set_body<B: Into<hyper::Body>>(&mut self, body: B) {
        self.inner.set_body(body.into());
    }

The body could possibly be more generic, as per the hyper crate which would allow such things as providing a Stream directly to the body, simplifying implementation for more tricky things (like streaming files from disk).

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

1 participant