summary refs log tree commit diff
path: root/src/libstd/io/util.rs
AgeCommit message (Collapse)AuthorLines
2014-03-20rename std::vec -> std::sliceDaniel Micay-1/+1
Closes #12702
2014-02-23Closes #12386. Removed 'pub mod' doc-comments in std::io's mod.rs file. ↵zslayton-0/+2
Added summary doc-comments to test.rs, util.rs and stdio.rs.
2014-02-20Mass rename if_ok! to try!Alex Crichton-1/+1
This "bubble up an error" macro was originally named if_ok! in order to get it landed, but after the fact it was discovered that this name is not exactly desirable. The name `if_ok!` isn't immediately clear that is has much to do with error handling, and it doesn't look fantastic in all contexts (if if_ok!(...) {}). In general, the agreed opinion about `if_ok!` is that is came in as subpar. The name `try!` is more invocative of error handling, it's shorter by 2 letters, and it looks fitting in almost all circumstances. One concern about the word `try!` is that it's too invocative of exceptions, but the belief is that this will be overcome with documentation and examples. Close #12037
2014-02-15Add a method to LimitReader to return the limitSteven Fackler-2/+24
This is useful in contexts like this: let size = rdr.read_be_i32() as uint; let mut limit = LimitReader::new(rdr.by_ref(), size); let thing = read_a_thing(&mut limit); assert!(limit.limit() == 0);
2014-02-15Update LimitReader to take the Reader to wrap by valuePalmer Cox-7/+8
2014-02-03std: Fix tests with io_error usageAlex Crichton-14/+17
2014-02-03std: Remove io::io_errorAlex Crichton-26/+38
* All I/O now returns IoResult<T> = Result<T, IoError> * All formatting traits now return fmt::Result = IoResult<()> * The if_ok!() macro was added to libstd
2014-01-17Tweak the interface of std::ioAlex Crichton-1/+1
* Reexport io::mem and io::buffered structs directly under io, make mem/buffered private modules * Remove with_mem_writer * Remove DEFAULT_CAPACITY and use DEFAULT_BUF_SIZE (in io::buffered)
2014-01-09Remove eof() from io::ReaderAlex Crichton-25/+0
2014-01-08Remove the io::Decorator traitAlex Crichton-3/+2
This is just an unnecessary trait that no one's ever going to parameterize over and it's more useful to just define the methods directly on the types themselves. The implementors of this type almost always don't want inner_mut_ref() but they're forced to define it as well.
2014-01-07stdtest: Fix all leaked trait importsAlex Crichton-0/+1
2013-12-20std: silence warnings when compiling test.Huon Wilson-2/+2
2013-12-11Add std::io::utilSteven Fackler-0/+295
This adds a bunch of useful Reader and Writer implementations. I'm not a huge fan of the name `util` but I can't think of a better name and I don't want to make `std::io` any longer than it already is.