We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aeb3af8 commit 2bed205Copy full SHA for 2bed205
src/libstd/io/mod.rs
@@ -1482,6 +1482,24 @@ impl<T> Take<T> {
1482
///
1483
/// This instance may reach EOF after reading fewer bytes than indicated by
1484
/// this method if the underlying `Read` instance reaches EOF.
1485
+ ///
1486
+ /// # Examples
1487
1488
+ /// ```
1489
+ /// use std::io;
1490
+ /// use std::io::prelude::*;
1491
+ /// use std::fs::File;
1492
1493
+ /// # fn foo() -> io::Result<()> {
1494
+ /// let f = try!(File::open("foo.txt"));
1495
1496
+ /// // read at most five bytes
1497
+ /// let handle = f.take(5);
1498
1499
+ /// println!("limit: {}", handle.limit());
1500
+ /// # Ok(())
1501
+ /// # }
1502
1503
#[stable(feature = "rust1", since = "1.0.0")]
1504
pub fn limit(&self) -> u64 { self.limit }
1505
}
0 commit comments