pub fn sender(&mut self) -> Option<Sender<T>> {
        // A sender is created only if no sender is alive.
        //
        // Transitions:
        //
        // |  I  O  E  |  I  O  E  |
        // |-----------|-----------|
        // |  x  0  0  |  0  1  1  | -> Return Some(Sender)
        // |  x  0  1  |  0  1  1  | -> Return Some(Sender)
        // |  x  1  1  |  x  1  1  | -> Return None
        // |  x  1  0  |  x  1  0  | -> Return None

        // Retrieve the current state.
        //
        // Ordering: This load synchronizes with the Release store in the
        // `Sender::send` method to ensure that the value (if any) is visible
        // and can be safely dropped.
        //
        // Safety: it is safe to access `inner` as we did not clear the `OPEN`
        // flag.
        let state = unsafe { self.inner.as_ref().state.load(Ordering::Acquire) };

        // Verify that there is no live sender.
        if state & OPEN == 0 {
            // Safety: the previous sender (if any) known to be consumed and the
            // Acquire ordering on the state ensures that all previous memory
            // operations by the previous sender are visible.
            Some(unsafe { self.sender_with_waker(state, None) })
        } else {
            None
        }
    }
/// Returns a new sender if there is currently no live sender.
///
/// This operation is wait-free. It is guaranteed to succeed (i) on its
/// first invocation and (ii) on further invocations if the future returned
/// by [`recv`](Receiver::recv) has been `await`ed (i.e. polled to
/// completion) after the previous sender was created.
Returns a new sender if there is currently no live sender.
This operation is wait-free. It is guaranteed to succeed (i) on its
first invocation and (ii) on further invocations if the future returned
by [`recv`](Receiver::recv) has been `await`ed  after the previous sender was created.
Returns a new sender if there is currently no live sender . This operation is wait - free . It is guaranteed to succeed ( i ) on its first invocation and ( ii ) on further invocations if the future returned by [ ` recv ` ] ( Receiver :: recv ) has been ` await ` ed after the previous sender was created .
pub fn sender(&mut self) -> Option<Sender<T>> {
        // A sender is created only if no sender is alive.
        //
        // Transitions:
        //
        // |  I  O  E  |  I  O  E  |
        // |-----------|-----------|
        // |  x  0  0  |  0  1  1  | -> Return Some(Sender)
        // |  x  0  1  |  0  1  1  | -> Return Some(Sender)
        // |  x  1  1  |  x  1  1  | -> Return None
        // |  x  1  0  |  x  1  0  | -> Return None
        // Retrieve the current state.
        //
        // Ordering: This load synchronizes with the Release store in the
        // `Sender::send` method to ensure that the value (if any) is visible
        // and can be safely dropped.
        //
        // Safety: it is safe to access `inner` as we did not clear the `OPEN`
        // flag.
        let state = unsafe { self.inner.as_ref().state.load(Ordering::Acquire) };
        // Verify that there is no live sender.
        if state & OPEN == 0 {
            // Safety: the previous sender (if any) known to be consumed and the
            // Acquire ordering on the state ensures that all previous memory
            // operations by the previous sender are visible.
            Some(unsafe { self.sender_with_waker(state, None) })
        } else {
            None
        }
    }
pub fn sender ( & mut self ) -> Option < Sender < T > > { // A sender is created only if no sender is alive. // // Transitions: // // |  I  O  E  |  I  O  E  | // |-----------|-----------| // |  x  0  0  |  0  1  1  | -> Return Some(Sender) // |  x  0  1  |  0  1  1  | -> Return Some(Sender) // |  x  1  1  |  x  1  1  | -> Return None // |  x  1  0  |  x  1  0  | -> Return None // Retrieve the current state. // // Ordering: This load synchronizes with the Release store in the // `Sender::send` method to ensure that the value (if any) is visible // and can be safely dropped. // // Safety: it is safe to access `inner` as we did not clear the `OPEN` // flag. let state = unsafe { self . inner . as_ref ( ) . state . load ( Ordering :: Acquire ) } ; // Verify that there is no live sender. if state & OPEN == 0 { // Safety: the previous sender (if any) known to be consumed and the // Acquire ordering on the state ensures that all previous memory // operations by the previous sender are visible. Some ( unsafe { self . sender_with_waker ( state , None ) } ) } else { None } }
Returns a new sender if there is currently no live sender.
Returns a new sender if there is currently no live sender .
&mut self