// calling close on a websocket that has already been closed by the other party has no effect
calling close on a websocket that has already been closed by the other party has no effect
calling close on a websocket that has already been closed by the other party has no effect
pub fn close<E>(
        &mut self,
        stream: &mut impl Stream<E>,
        close_status: WebSocketCloseStatusCode,
        status_description: Option<&str>,
    ) -> Result<(), FramerError<E>> {
        let len = self
            .websocket
            .close(close_status, status_description, self.write_buf)
            .map_err(FramerError::WebSocket)?;
        stream
            .write_all(&self.write_buf[..len])
            .map_err(FramerError::Io)?;
        Ok(())
    }
pub fn close < E > ( & mut self , stream : & mut impl Stream < E > , close_status : WebSocketCloseStatusCode , status_description : Option < & str > , ) -> Result < ( ) , FramerError < E > > { let len = self . websocket . close ( close_status , status_description , self . write_buf ) . map_err ( FramerError :: WebSocket ) ? ; stream . write_all ( & self . write_buf [ .. len ] ) . map_err ( FramerError :: Io ) ? ; Ok ( ( ) ) }
calling close on a websocket that has already been closed by the other party has no effect
calling close on a websocket that has already been closed by the other party has no effect
&mut self
stream
&mut impl Stream<E>
close_status
WebSocketCloseStatusCode
status_description
Option<&str>