Home | History | Annotate | Download | only in io

Lines Matching defs:pipe

5 // Pipe adapter to connect code expecting an io.Reader
28 // ErrClosedPipe is the error used for read or write operations on a closed pipe.
29 var ErrClosedPipe = errors.New("io: read/write on closed pipe")
31 // A pipe is the shared pipe structure underlying PipeReader and PipeWriter.
32 type pipe struct {
43 func (p *pipe) Read(b []byte) (n int, err error) {
60 func (p *pipe) readCloseError() error {
68 func (p *pipe) CloseRead(err error) error {
77 func (p *pipe) Write(b []byte) (n int, err error) {
99 func (p *pipe) writeCloseError() error {
107 func (p *pipe) CloseWrite(err error) error {
116 // A PipeReader is the read half of a pipe.
118 p *pipe
122 // it reads data from the pipe, blocking until a writer
131 // write half of the pipe will return the error ErrClosedPipe.
137 // to the write half of the pipe will return the error err.
142 // A PipeWriter is the write half of a pipe.
144 p *pipe
148 // it writes data to the pipe, blocking until one or more readers
157 // read half of the pipe will return no bytes and EOF.
163 // read half of the pipe will return no bytes and the error err,
171 // Pipe creates a synchronous in-memory pipe.
175 // Reads and Writes on the pipe are matched one to one
186 func Pipe() (*PipeReader, *PipeWriter) {
187 p := &pipe{