fn send_client_handshake<T,U>(&mut self, mut buf: T) -> Result<(usize, ConnectionState), OssuaryError>
    where T: std::ops::DerefMut<Target = U>,
          U: std::io::Write {
        // Send session public key and nonce to initiate connection
        let chal = self.local_auth.challenge.unwrap_or([0u8; CHALLENGE_LEN]);
        let pkt = ClientHandshakePacket::new(&self.local_key.public,
                                             &self.local_key.nonce,
                                             &chal);
        let w = write_packet(self, buf.deref_mut(), struct_as_slice(&pkt),
                             PacketType::ClientHandshake)?;
        let state = ConnectionState::ClientWaitHandshake(std::time::SystemTime::now());
        Ok((w, state))
    }
/// Ready to send a client handshake packet
Ready to send a client handshake packet
Ready to send a client handshake packet
fn send_client_handshake<T,U>(&mut self, mut buf: T) -> Result<(usize, ConnectionState), OssuaryError>
    where T: std::ops::DerefMut<Target = U>,
          U: std::io::Write {
        // Send session public key and nonce to initiate connection
        let chal = self.local_auth.challenge.unwrap_or([0u8; CHALLENGE_LEN]);
        let pkt = ClientHandshakePacket::new(&self.local_key.public,
                                             &self.local_key.nonce,
                                             &chal);
        let w = write_packet(self, buf.deref_mut(), struct_as_slice(&pkt),
                             PacketType::ClientHandshake)?;
        let state = ConnectionState::ClientWaitHandshake(std::time::SystemTime::now());
        Ok((w, state))
    }
fn send_client_handshake < T , U > ( & mut self , mut buf : T ) -> Result < ( usize , ConnectionState ) , OssuaryError > where T : std :: ops :: DerefMut < Target = U > , U : std :: io :: Write { // Send session public key and nonce to initiate connection let chal = self . local_auth . challenge . unwrap_or ( [ 0u8 ; CHALLENGE_LEN ] ) ; let pkt = ClientHandshakePacket :: new ( & self . local_key . public , & self . local_key . nonce , & chal ) ; let w = write_packet ( self , buf . deref_mut ( ) , struct_as_slice ( & pkt ) , PacketType :: ClientHandshake ) ? ; let state = ConnectionState :: ClientWaitHandshake ( std :: time :: SystemTime :: now ( ) ) ; Ok ( ( w , state ) ) }
Ready to send a client handshake packet
Ready to send a client handshake packet
&mut self
buf
T
&mut self
buf
T