]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/io/mod.rs
rollup merge of #23668: alexcrichton/io-zero
[rust.git] / src / libstd / io / mod.rs
index 33c4156fc0ce799608567afa1ab37d30bb443632..c6ae4d0dbec7d87d0ce650569fadfd8467cd91f0 100644 (file)
@@ -542,6 +542,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);