pub fn close(&self) -> io::Result<()> {
        match self.state.lock() {
            Ok(mut state) => {
                state.closed = true;
                self.wake_reader_half(&*state);
                Ok(())
            }
            Err(err) => Err(io::Error::new(
                io::ErrorKind::Other,
                format!(
                    "{}: PipeWriter: Failed to lock the channel state: {}",
                    env!("CARGO_PKG_NAME"),
                    err
                ),
            )),
        }
    }
/// Closes the pipe, any further read will return EOF and any further write will raise an error.
Closes the pipe, any further read will return EOF and any further write will raise an error.
Closes the pipe any further read will return EOF and any further write will raise an error .
pub fn close(&self) -> io::Result<()> {
        match self.state.lock() {
            Ok(mut state) => {
                state.closed = true;
                self.wake_reader_half(&*state);
                Ok(())
            }
            Err(err) => Err(io::Error::new(
                io::ErrorKind::Other,
                format!(
                    "{}: PipeWriter: Failed to lock the channel state: {}",
                    env!("CARGO_PKG_NAME"),
                    err
                ),
            )),
        }
    }
pub fn close ( & self ) -> io :: Result < ( ) > { match self . state . lock ( ) { Ok ( mut state ) => { state . closed = true ; self . wake_reader_half ( & * state ) ; Ok ( ( ) ) } Err ( err ) => Err ( io :: Error :: new ( io :: ErrorKind :: Other , format ! ( " " env ( " " ) err ) , ) ) , } }
Closes the pipe, any further read will return EOF and any further write will raise an error.
Closes the pipe any further read will return EOF and any further write will raise an error .
&self
&self