Home | History | Annotate | Download | only in io

Lines Matching defs:Pipe

5 // Pipe adapter to connect code expecting an io.Reader
15 // ErrClosedPipe is the error used for read or write operations on a closed pipe.
16 var ErrClosedPipe = errors.New("io: read/write on closed pipe")
18 // A pipe is the shared pipe structure underlying PipeReader and PipeWriter.
19 type pipe struct {
30 func (p *pipe) read(b []byte) (n int, err error) {
60 func (p *pipe) write(b []byte) (n int, err error) {
61 // pipe uses nil to mean not available
97 func (p *pipe) rclose(err error) {
108 func (p *pipe) wclose(err error) {
119 // A PipeReader is the read half of a pipe.
121 p *pipe
125 // it reads data from the pipe, blocking until a writer
134 // write half of the pipe will return the error ErrClosedPipe.
140 // to the write half of the pipe will return the error err.
146 // A PipeWriter is the write half of a pipe.
148 p *pipe
152 // it writes data to the pipe, blocking until one or more readers
161 // read half of the pipe will return no bytes and EOF.
167 // read half of the pipe will return no bytes and the error err,
176 // Pipe creates a synchronous in-memory pipe.
180 // Reads and Writes on the pipe are matched one to one
191 func Pipe() (*PipeReader, *PipeWriter) {
192 p := new(pipe)