{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/1235","labels_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1235/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1235/comments","events_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1235/events","html_url":"https://github.com/rust-lang/rfcs/pull/1235","id":98853063,"number":1235,"title":"More control over `BufReader`","user":{"login":"cybergeek94","id":3198595,"avatar_url":"https://avatars.githubusercontent.com/u/3198595?v=3","gravatar_id":"","url":"https://api.github.com/users/cybergeek94","html_url":"https://github.com/cybergeek94","followers_url":"https://api.github.com/users/cybergeek94/followers","following_url":"https://api.github.com/users/cybergeek94/following{/other_user}","gists_url":"https://api.github.com/users/cybergeek94/gists{/gist_id}","starred_url":"https://api.github.com/users/cybergeek94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cybergeek94/subscriptions","organizations_url":"https://api.github.com/users/cybergeek94/orgs","repos_url":"https://api.github.com/users/cybergeek94/repos","events_url":"https://api.github.com/users/cybergeek94/events{/privacy}","received_events_url":"https://api.github.com/users/cybergeek94/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rfcs/labels/T-libs","name":"T-libs","color":"bfd4f2"}],"state":"open","locked":false,"assignee":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"milestone":null,"comments":28,"created_at":"2015-08-03T22:51:43Z","updated_at":"2015-08-17T17:29:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rust-lang/rfcs/pulls/1235","html_url":"https://github.com/rust-lang/rfcs/pull/1235","diff_url":"https://github.com/rust-lang/rfcs/pull/1235.diff","patch_url":"https://github.com/rust-lang/rfcs/pull/1235.patch"},"body":"[Rendered.](https://github.com/cybergeek94/rfcs/blob/master/text/0000-bufreader-methods.md)"},"comment":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/comments/131897098","html_url":"https://github.com/rust-lang/rfcs/pull/1235#issuecomment-131897098","issue_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1235","id":131897098,"user":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"created_at":"2015-08-17T17:29:28Z","updated_at":"2015-08-17T17:29:28Z","body":"@cybergeek94 I think I understand your use case here, and I definitely agree that this sort of abstraction should be consolidated and it shouldn't need to be maintained separately. That being said, I'm still hung up on this point:\r\n\r\n> Sometimes, the one read it performs on the source doesn't give me enough data in the buffer to work with. So I need more, but without discarding the existing data from memory.\r\n\r\nIn your specific use case this may work out, but in general this isn't a problem the current `BufReader` type can solve. A `BufReader` does not dynamically grow its internal buffer, so it's possible that a request to read more data simply can't succeed. This means that the API proposed here, `read_info_buf`, doesn't actually provide the guarantee that it reads any more data, so you *already have to be ready for this situation*. As a result, you'll already need to have your own side buffer and handle this logic, so this extra method would purely be a performance optimization rather than a fundamental addition I think."}}