1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
use crate;
use crateLazy;
use ;
// ERR_SHORT_WRITE means that a write accepted fewer bytes than requested
// but failed to return an explicit error.
pub static ERR_SHORT_WRITE: = new;
// ERR_INVALID_WRITE means that a write returned an impossible count.
pub static ERR_INVALID_WRITE: = new;
// ERR_SHORT_BUFFER means that a read required a longer buffer than was provided.
pub static ERR_SHORT_BUFFER: = new;
// EOF is the error returned by Read when no more input is available.
// (Read must return EOF itself, not an error wrapping EOF,
// because callers will test for EOF using ==.)
// Functions should return EOF only to signal a graceful end of input.
// If the EOF occurs unexpectedly in a structured data stream,
// the appropriate error is either ERR_UNEXPECTED_EOF or some other error
// giving more detail.
pub static EOF: = new;
// ERR_UNEXPECTED_EOF means that EOF was encountered in the
// middle of reading a fixed-size block or data structure.
pub static ERR_UNEXPECTED_EOF: = new;
// ERR_NO_PROGRESS is returned by some clients of an Reader when
// many calls to Read have failed to return any data or error,
// usually the sign of a broken Reader implementation.
pub static ERR_NO_PROGRESS: =
new;
// Closer is the interface that wraps the basic Close method.
//
// The behavior of Close after the first call is undefined.
// Specific implementations may document their own behavior.
/// ReadAll reads from r until an error or EOF and returns the data it read.
/// A successful call returns err == nil, not err == EOF. Because ReadAll is
/// defined to read from src until EOF, it does not treat an EOF from Read
/// as an error to be reported.