pub async fn handshake(mut self) -> Result<Protocol<T, main::Stage>>
    {
        if !self.io.options.noise {
            return self.establish(None)
        }

        loop {
            let event = self.next().await.unwrap()?;
            match event {
                Event::Handshake(result) => {
                    return self.establish(Some(result))
                }
            }
        }
    }
/// Wait for handshake and upgrade to [Protocol<IO>].
Wait for handshake and upgrade to [Protocol].
Wait for handshake and upgrade to [ Protocol ] .
pub async fn handshake(mut self) -> Result<Protocol<T, main::Stage>>
    {
        if !self.io.options.noise {
            return self.establish(None)
        }
        loop {
            let event = self.next().await.unwrap()?;
            match event {
                Event::Handshake(result) => {
                    return self.establish(Some(result))
                }
            }
        }
    }
pub async fn handshake ( mut self ) -> Result < Protocol < T , main :: Stage > > { if ! self . io . options . noise { return self . establish ( None ) } loop { let event = self . next ( ) . await . unwrap ( ) ? ; match event { Event :: Handshake ( result ) => { return self . establish ( Some ( result ) ) } } } }
Wait for handshake and upgrade to [Protocol<IO>].
Wait for handshake and upgrade to [ Protocol<IO > ] .
mut self
mut self