pub(crate) fn try_send(&mut self, value: T) -> Result<(), (T, TrySendError)> {
        if let Err(e) = self.inner.semaphore.try_acquire(&mut self.permit) {
            return Err((value, e));
        }

        // Push the value
        self.inner.tx.push(value);

        // Notify the rx task
        self.inner.rx_task.notify();

        // Release the permit
        self.inner.semaphore.forget(&mut self.permit);

        Ok(())
    }
/// Send a message and notify the receiver.
Send a message and notify the receiver.
Send a message and notify the receiver .
pub(crate) fn try_send(&mut self, value: T) -> Result<(), (T, TrySendError)> {
        if let Err(e) = self.inner.semaphore.try_acquire(&mut self.permit) {
            return Err((value, e));
        }
        // Push the value
        self.inner.tx.push(value);
        // Notify the rx task
        self.inner.rx_task.notify();
        // Release the permit
        self.inner.semaphore.forget(&mut self.permit);
        Ok(())
    }
pub ( crate ) fn try_send ( & mut self , value : T ) -> Result < ( ) , ( T , TrySendError ) > { if let Err ( e ) = self . inner . semaphore . try_acquire ( & mut self . permit ) { return Err ( ( value , e ) ) ; } // Push the value self . inner . tx . push ( value ) ; // Notify the rx task self . inner . rx_task . notify ( ) ; // Release the permit self . inner . semaphore . forget ( & mut self . permit ) ; Ok ( ( ) ) }
Send a message and notify the receiver.
Send a message and notify the receiver .
&mut self
value
T