diff options
| author | bors <bors@rust-lang.org> | 2015-03-24 17:38:09 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-03-24 17:38:09 +0000 |
| commit | ed810385045ab0db90303574ba3ea47dfa2a36d5 (patch) | |
| tree | 161242c800aca625a26c56551fa5adb446c0089f /src/libstd/io | |
| parent | 28a0b25f424090255966273994748a9f9901059f (diff) | |
| parent | d252d0ad5434bcf77076729ab766eeff98f20ead (diff) | |
| download | rust-ed810385045ab0db90303574ba3ea47dfa2a36d5.tar.gz rust-ed810385045ab0db90303574ba3ea47dfa2a36d5.zip | |
Auto merge of #23654 - alexcrichton:rollup, r=alexcrichton
Diffstat (limited to 'src/libstd/io')
| -rw-r--r-- | src/libstd/io/buffered.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/cursor.rs | 14 | ||||
| -rw-r--r-- | src/libstd/io/mod.rs | 6 |
3 files changed, 13 insertions, 9 deletions
diff --git a/src/libstd/io/buffered.rs b/src/libstd/io/buffered.rs index 43eec695274..4def601f1c0 100644 --- a/src/libstd/io/buffered.rs +++ b/src/libstd/io/buffered.rs @@ -258,7 +258,7 @@ impl<W> FromError<IntoInnerError<W>> for Error { } #[stable(feature = "rust1", since = "1.0.0")] -impl<W> error::Error for IntoInnerError<W> { +impl<W: Send + fmt::Debug> error::Error for IntoInnerError<W> { fn description(&self) -> &str { error::Error::description(self.error()) } diff --git a/src/libstd/io/cursor.rs b/src/libstd/io/cursor.rs index 87e5a2a4488..79f0af670b4 100644 --- a/src/libstd/io/cursor.rs +++ b/src/libstd/io/cursor.rs @@ -17,20 +17,18 @@ use iter::repeat; use num::Int; use slice; -/// A `Cursor` is a type which wraps another I/O object to provide a `Seek` +/// A `Cursor` is a type which wraps a non-I/O object to provide a `Seek` /// implementation. /// -/// Cursors are currently typically used with memory buffer objects in order to -/// allow `Seek` plus `Read` and `Write` implementations. For example, common -/// cursor types include: +/// Cursors are typically used with memory buffer objects in order to allow +/// `Seek`, `Read`, and `Write` implementations. For example, common cursor types +/// include `Cursor<Vec<u8>>` and `Cursor<&[u8]>`. /// -/// * `Cursor<Vec<u8>>` -/// * `Cursor<&[u8]>` -/// -/// Implementations of the I/O traits for `Cursor<T>` are not currently generic +/// Implementations of the I/O traits for `Cursor<T>` are currently not generic /// over `T` itself. Instead, specific implementations are provided for various /// in-memory buffer types like `Vec<u8>` and `&[u8]`. #[stable(feature = "rust1", since = "1.0.0")] +#[derive(Clone, Debug)] pub struct Cursor<T> { inner: T, pos: u64, diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 237435d6dfb..39c718c96b3 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -558,6 +558,12 @@ pub trait BufRead: Read { /// This function does not perform any I/O, it simply informs this object /// that some amount of its buffer, returned from `fill_buf`, has been /// consumed and should no longer be returned. + /// + /// This function is used to tell the buffer how many bytes you've consumed + /// from the return value of `fill_buf`, and so may do odd things if + /// `fill_buf` isn't called before calling this. + /// + /// The `amt` must be `<=` the number of bytes in the buffer returned by `fill_buf`. #[stable(feature = "rust1", since = "1.0.0")] fn consume(&mut self, amt: usize); |
