rust icon indicating copy to clipboard operation
rust copied to clipboard

Add a io::Writer wrapper that supports pushback

Open erickt opened this issue 14 years ago • 7 comments

C's stdio has a function ungetc that lets you push back a single char on a stream. While we could expose support for the c functions, this wouldn't help with our str/bytes writers. Instead, how about we make a trait/impl io::Writer wrapper that supports lookahead and pushback for any io::Writers?

erickt avatar Nov 24 '12 20:11 erickt

Nominating for Maturity 5, Production Ready

bstrie avatar May 28 '13 18:05 bstrie

sub-bug of #4248, and a feature

graydon avatar Jul 18 '13 17:07 graydon

accepted for feature-complete milestone

graydon avatar Jul 18 '13 17:07 graydon

assigning P-low.

pnkfelix avatar Jan 22 '14 18:01 pnkfelix

Shouldn't this be an io::Reader wrapper?

sfackler avatar Jan 22 '14 19:01 sfackler

Is something like this what everyone has in mind? https://gist.github.com/pongad/9316641 I can open a PR if everyone likes it ok.

pongad avatar Mar 03 '14 00:03 pongad

I'm pulling a massive triage effort to get us ready for 1.0. As part of this, I'm moving stuff that's wishlist-like to the RFCs repo, as that's where major new things should get discussed/prioritized.

This issue has been moved to the RFCs repo: rust-lang/rfcs#856

steveklabnik avatar Feb 15 '15 18:02 steveklabnik