You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: websocket_stream.rs
    path of file: ./repos/tunshell/tunshell-client/src/server
    
    the code of the file until where you have to start completion: use super::tls_stream::TlsServerStream;
use crate::Config;
use anyhow::Result;
use async_tungstenite::{client_async, tungstenite::Message, WebSocketStream};
use futures::{stream::StreamExt,
    
    fn poll_flush(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), io::Error>> {
        if self.write_buff.is_none() {
            return Poll::Ready(Ok(()));
        }

        if let Poll::Pending = self.inner.poll_ready_unpin(cx) {
            return Poll::Pending;
        }

        let msg = self.write_buff.take().unwrap();
        if let Err(err) = self.inner.start_send_unpin(msg) {
            error!("error while writing to websocket: {}", err);
            return Poll::Ready(Err(io::Error::from(io::ErrorKind::BrokenPipe)));
        }

        if let Poll::Pending = self.inner.poll_flush_unpin(cx) {
            return Poll::Pending;
        }

        return Poll::Ready(Ok(()));
    }