pub(super) fn write_pending<Stream>(&mut self, stream: &mut Stream) -> Result<()>
    where
        Stream: Write,
    {
        while !self.out_buffer.is_empty() {
            let len = stream.write(&self.out_buffer)?;
            if len == 0 {
                // This is the same as "Connection reset by peer"
                return Err(IoError::new(
                    IoErrorKind::ConnectionReset,
                    "Connection reset while sending",
                )
                .into());
            }
            self.out_buffer.drain(0..len);
        }
        stream.flush()?;
        Ok(())
    }
/// Complete pending write, if any.
Complete pending write, if any.
Complete pending write if any .
pub(super) fn write_pending<Stream>(&mut self, stream: &mut Stream) -> Result<()>
    where
        Stream: Write,
    {
        while !self.out_buffer.is_empty() {
            let len = stream.write(&self.out_buffer)?;
            if len == 0 {
                // This is the same as "Connection reset by peer"
                return Err(IoError::new(
                    IoErrorKind::ConnectionReset,
                    "Connection reset while sending",
                )
                .into());
            }
            self.out_buffer.drain(0..len);
        }
        stream.flush()?;
        Ok(())
    }
pub ( super ) fn write_pending < Stream > ( & mut self , stream : & mut Stream ) -> Result < ( ) > where Stream : Write , { while ! self . out_buffer . is_empty ( ) { let len = stream . write ( & self . out_buffer ) ? ; if len == 0 { // This is the same as "Connection reset by peer" return Err ( IoError :: new ( IoErrorKind :: ConnectionReset , " " , ) . into ( ) ) ; } self . out_buffer . drain ( 0 .. len ) ; } stream . flush ( ) ? ; Ok ( ( ) ) }
Complete pending write, if any.
Complete pending write if any .
&mut self
stream
&mut Stream
&mut self
stream
&mut Stream