Lines Matching defs:pipe
16 type pipe struct { struct
17 mu sync.Mutex
18 c sync.Cond // c.L lazily initialized to &p.mu
19 b pipeBuffer // nil when done reading
20 unread int // bytes unread when done
21 err error // read error once empty. non-nil means closed.
22 breakErr error // immediate read error (caller doesn't see rest of b)
23 donec chan struct{} // closed on error
24 readFn func() // optional code to run in Read before error
33 func (p *pipe) Len() int {
44 func (p *pipe) Read(d []byte) (n int, err error) {
73 func (p *pipe) Write(d []byte) (n int, err error) {
95 func (p *pipe) CloseWithError(err error) { p.closeWithError(&p.err, err, nil) }
100 func (p *pipe) BreakWithError(err error) { p.closeWithError(&p.breakErr, err, nil) }
104 func (p *pipe) closeWithErrorAndCode(err error, fn func()) { p.closeWithError(&p.err, err, fn) }
106 func (p *pipe) closeWithError(dst *error, err error, fn func()) {
132 func (p *pipe) closeDoneLocked() {
146 func (p *pipe) Err() error {
157 func (p *pipe) Done() <-chan struct{} {