summary refs log tree commit diff
path: root/src/libstd/io/error.rs
diff options
context:
space:
mode:
authorCesar Eduardo Barros <cesarb@cesarb.eti.br>2015-07-20 00:23:37 -0300
committerCesar Eduardo Barros <cesarb@cesarb.eti.br>2015-08-24 19:10:08 -0300
commitff81920f03866674080ac63b565cc9d30f80c450 (patch)
tree9619a464863630730373297a9a35e7bccba94fcf /src/libstd/io/error.rs
parentef04b07239d75f2b6bb66f18855f3af695d76e1c (diff)
downloadrust-ff81920f03866674080ac63b565cc9d30f80c450.tar.gz
rust-ff81920f03866674080ac63b565cc9d30f80c450.zip
Implement read_exact for the Read trait
This implements the proposed "read_exact" RFC
(https://github.com/rust-lang/rfcs/pull/980).
Diffstat (limited to 'src/libstd/io/error.rs')
-rw-r--r--src/libstd/io/error.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libstd/io/error.rs b/src/libstd/io/error.rs
index 3b48ff30960..d55721db126 100644
--- a/src/libstd/io/error.rs
+++ b/src/libstd/io/error.rs
@@ -147,6 +147,15 @@ pub enum ErrorKind {
     #[stable(feature = "rust1", since = "1.0.0")]
     Other,
 
+    /// An error returned when an operation could not be completed because an
+    /// "end of file" was reached prematurely.
+    ///
+    /// This typically means that an operation could only succeed if it read a
+    /// particular number of bytes but only a smaller number of bytes could be
+    /// read.
+    #[unstable(feature = "read_exact", reason = "recently added")]
+    UnexpectedEOF,
+
     /// Any I/O error not part of this list.
     #[unstable(feature = "io_error_internals",
                reason = "better expressed through extensible enums that this \