{"action":"created","issue":{"url":"https://api.github.com/repos/hyperium/hyper/issues/1328","repository_url":"https://api.github.com/repos/hyperium/hyper","labels_url":"https://api.github.com/repos/hyperium/hyper/issues/1328/labels{/name}","comments_url":"https://api.github.com/repos/hyperium/hyper/issues/1328/comments","events_url":"https://api.github.com/repos/hyperium/hyper/issues/1328/events","html_url":"https://github.com/hyperium/hyper/issues/1328","id":259088765,"number":1328,"title":"Allow hyper::Body to be created from Read or AsyncRead","user":{"login":"cetra3","id":6415435,"avatar_url":"https://avatars0.githubusercontent.com/u/6415435?v=4","gravatar_id":"","url":"https://api.github.com/users/cetra3","html_url":"https://github.com/cetra3","followers_url":"https://api.github.com/users/cetra3/followers","following_url":"https://api.github.com/users/cetra3/following{/other_user}","gists_url":"https://api.github.com/users/cetra3/gists{/gist_id}","starred_url":"https://api.github.com/users/cetra3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cetra3/subscriptions","organizations_url":"https://api.github.com/users/cetra3/orgs","repos_url":"https://api.github.com/users/cetra3/repos","events_url":"https://api.github.com/users/cetra3/events{/privacy}","received_events_url":"https://api.github.com/users/cetra3/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-09-20T08:54:38Z","updated_at":"2017-09-26T12:39:32Z","closed_at":"2017-09-24T00:16:09Z","author_association":"NONE","body":"I'd like to be able to construct a response from a static File or a Read interface.  Not sure if this is already possible.\r\n\r\nI.e, \r\n\r\n```\r\n    let f = File::open(\"example.txt\").unwrap();\r\n    let body = hyper::Body::from(f);\r\n```"},"comment":{"url":"https://api.github.com/repos/hyperium/hyper/issues/comments/332184962","html_url":"https://github.com/hyperium/hyper/issues/1328#issuecomment-332184962","issue_url":"https://api.github.com/repos/hyperium/hyper/issues/1328","id":332184962,"user":{"login":"srijs","id":2677165,"avatar_url":"https://avatars0.githubusercontent.com/u/2677165?v=4","gravatar_id":"","url":"https://api.github.com/users/srijs","html_url":"https://github.com/srijs","followers_url":"https://api.github.com/users/srijs/followers","following_url":"https://api.github.com/users/srijs/following{/other_user}","gists_url":"https://api.github.com/users/srijs/gists{/gist_id}","starred_url":"https://api.github.com/users/srijs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srijs/subscriptions","organizations_url":"https://api.github.com/users/srijs/orgs","repos_url":"https://api.github.com/users/srijs/repos","events_url":"https://api.github.com/users/srijs/events{/privacy}","received_events_url":"https://api.github.com/users/srijs/received_events","type":"User","site_admin":false},"created_at":"2017-09-26T12:39:32Z","updated_at":"2017-09-26T12:39:32Z","author_association":"CONTRIBUTOR","body":"Hmm, seems like this is starting to become more tricky. Your current problem would be solved by using `Client::configure().body::<FsReadStream>().build()`, but then the next problem will be that `FsReadStream` has error type `std::io::Error`, where `Config::build()` expects the body to have error type `hyper::Error`\r\n\r\n@seanmonstar Can you think of anything that might make this easier? For instance, could we change `Config::build` to be able to automatically cast errors?\r\n\r\nI'm thinking something like\r\n\r\n```rust\r\nimpl<B> Config<UseDefaultConnector, B>\r\nwhere B: Stream,\r\n      B::Item: AsRef<[u8]>,\r\n      B::Error: Into<hyper::Error>\r\n{\r\n    ...\r\n}\r\n```"}}
{"actor":{"display_login":"srijs"}}