pub fn close(&mut self) {
        let items = match self.state {
            State::Open(ref state) => {
                let mut state = state.borrow_mut();
                mem::replace(&mut state.buffer, VecDeque::new())
            }
            State::Closed(_) => return,
        };
        self.state = State::Closed(items);
    }
/// Closes the receiving half
///
/// This prevents any further messages from being sent on the channel while
/// still enabling the receiver to drain messages that are buffered.
Closes the receiving half
This prevents any further messages from being sent on the channel while
still enabling the receiver to drain messages that are buffered.
Closes the receiving half This prevents any further messages from being sent on the channel while still enabling the receiver to drain messages that are buffered .
pub fn close(&mut self) {
        let items = match self.state {
            State::Open(ref state) => {
                let mut state = state.borrow_mut();
                mem::replace(&mut state.buffer, VecDeque::new())
            }
            State::Closed(_) => return,
        };
        self.state = State::Closed(items);
    }
pub fn close ( & mut self ) { let items = match self . state { State :: Open ( ref state ) => { let mut state = state . borrow_mut ( ) ; mem :: replace ( & mut state . buffer , VecDeque :: new ( ) ) } State :: Closed ( _ ) => return , } ; self . state = State :: Closed ( items ) ; }
Closes the receiving half
This prevents any further messages from being sent on the channel while
still enabling the receiver to drain messages that are buffered.
Closes the receiving half This prevents any further messages from being sent on the channel while still enabling the receiver to drain messages that are buffered .
&mut self