fn buffered_send<'a>(
        &'a self,
        mut data: MutexGuard<'a, Data<T>>,
        try: bool,
        val: T,
    ) -> SendOp<'a, T> {
        while data.user.len() == self.cap {
            if data.closed {
                return SendOp::closed(data, val);
            }
            if try {
                return SendOp::blocked(data, val);
            }
            data = self.cond.wait(data).unwrap();
        }
        if data.closed {
            return SendOp::closed(data, val);
        }
        data.user.push(val);
        self.notify();
        SendOp::ok(data)
    }
// Buffered send is pretty much the dual of recv.
Buffered send is pretty much the dual of recv.
Buffered send is pretty much the dual of recv .
fn buffered_send<'a>(
        &'a self,
        mut data: MutexGuard<'a, Data<T>>,
        try: bool,
        val: T,
    ) -> SendOp<'a, T> {
        while data.user.len() == self.cap {
            if data.closed {
                return SendOp::closed(data, val);
            }
            if try {
                return SendOp::blocked(data, val);
            }
            data = self.cond.wait(data).unwrap();
        }
        if data.closed {
            return SendOp::closed(data, val);
        }
        data.user.push(val);
        self.notify();
        SendOp::ok(data)
    }
fn buffered_send < ' a > ( & ' a self , mut data : MutexGuard < ' a , Data < T > > , try : bool , val : T , ) -> SendOp < ' a , T > { while data . user . len ( ) == self . cap { if data . closed { return SendOp :: closed ( data , val ) ; } if try { return SendOp :: blocked ( data , val ) ; } data = self . cond . wait ( data ) . unwrap ( ) ; } if data . closed { return SendOp :: closed ( data , val ) ; } data . user . push ( val ) ; self . notify ( ) ; SendOp :: ok ( data ) }
Buffered send is pretty much the dual of recv.
Buffered send is pretty much the dual of recv .
&'a self
data
MutexGuard<'a, Data<T>>
try
bool
val
T
&'a self
data
MutexGuard<'a, Data<T>>
try
bool
val
T