summary refs log tree commit diff
path: root/src/libstd/io/mem.rs
AgeCommit message (Collapse)AuthorLines
2014-01-04Restore Writer.write_char, see #10861.Gareth Smith-0/+10
2014-01-03Add read_to_str and write_{str, line}Alex Crichton-0/+20
These methods are sorely needed on readers and writers, and I believe that the encoding story should be solved with composition. This commit adds back the missed functions when reading/writing strings onto generic Readers/Writers.
2013-12-15std::vec: remove unnecessary count parameter on {bytes,Huon Wilson-6/+4
raw}::copy_memory. Slices carry their length with them, so we can just use that information.
2013-12-11Make 'self lifetime illegal.Erik Price-11/+11
Also remove all instances of 'self within the codebase. This fixes #10889.
2013-12-01std::io::mem: add a with_capacity constructor to MemWriter.Huon Wilson-1/+7
This allows one to reduce the number of reallocs of the internal buffer if one has an approximate idea of the size of the final output.
2013-11-26test: Remove non-procedure uses of `do` from compiletest, libstd tests,Patrick Walton-3/+3
compile-fail tests, run-fail tests, and run-pass tests.
2013-11-19libstd: Change all uses of `&fn(A)->B` over to `|A|->B` in libstdPatrick Walton-1/+1
2013-11-17auto merge of #10466 : alexcrichton/rust/issue-10334, r=cmrbors-19/+29
These commits create a `Buffer` trait in the `io` module which represents an I/O reader which is internally buffered. This abstraction is used to reasonably implement `read_line` and `read_until` along with at least an ok implementation of `read_char` (although I certainly haven't benchmarked `read_char`).
2013-11-16Implement read_char on the Buffer traitAlex Crichton-0/+16
2013-11-13Introduce an io::Buffer traitAlex Crichton-19/+13
This trait is meant to abstract whether a reader is actually implemented with an underlying buffer. For all readers which are implemented as such, we can efficiently implement things like read_char, read_line, read_until, etc. There are two required methods for managing the internal buffer, and otherwise read_line and friends can all become default methods. Closes #10334
2013-11-13Implemented BufWriterZach Kamsler-10/+99
Filled in the implementations of Writer and Seek for BufWriter. It raises the io_error condition if a write cannot fit in the buffer. The Seek implementation for MemWriter, which was incorrectly using unsigned arithmatic to add signed offsets, has also been replaced.
2013-11-11Move std::rt::io to std::ioAlex Crichton-0/+308