diff options
Diffstat (limited to 'src/libstd/io/mod.rs')
| -rw-r--r-- | src/libstd/io/mod.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index e2fde98a77c..ea3e0219a5b 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -434,6 +434,17 @@ pub enum IoErrorKind { InvalidInput, /// The I/O operation's timeout expired, causing it to be canceled. TimedOut, + /// This write operation failed to write all of its data. + /// + /// Normally the write() method on a Writer guarantees that all of its data + /// has been written, but some operations may be terminated after only + /// partially writing some data. An example of this is a timed out write + /// which successfully wrote a known number of bytes, but bailed out after + /// doing so. + /// + /// The payload contained as part of this variant is the number of bytes + /// which are known to have been successfully written. + ShortWrite(uint), } /// A trait for objects which are byte-oriented streams. Readers are defined by @@ -1429,7 +1440,8 @@ pub fn standard_error(kind: IoErrorKind) -> IoError { PathDoesntExist => "no such file", MismatchedFileTypeForOperation => "mismatched file type", ResourceUnavailable => "resource unavailable", - TimedOut => "operation timed out" + TimedOut => "operation timed out", + ShortWrite(..) => "short write", }; IoError { kind: kind, |
