pub fn generate_connect_request(&mut self) -> Result<Vec<u8>> {
        let mut output = Vec::new();
        let mut output_len = 0;

        unsafe {
            let status = secure_session_generate_connect_request(
                self.session_ctx,
                ptr::null_mut(),
                &mut output_len,
            );
            let error = Error::from_session_status(status);
            if error.kind() != ErrorKind::BufferTooSmall {
                return Err(error);
            }
        }

        output.reserve(output_len);

        unsafe {
            let status = secure_session_generate_connect_request(
                self.session_ctx,
                output.as_mut_ptr() as *mut c_void,
                &mut output_len,
            );
            let error = Error::from_session_status(status);
            if error.kind() != ErrorKind::Success {
                return Err(error);
            }
            debug_assert!(output_len <= output.capacity());
            output.set_len(output_len);
        }

        Ok(output)
    }
/// Initiates connection to the remote peer, returns connection message.
///
/// This is the first method to call. It returns you a message that you must somehow
/// transfer to the remote peer and give it to its [`negotiate`] method. This results in
/// another message which must be transferred back to this Secure Session and passed to
/// its [`negotiate`] method. Continue passing these message around until the connection
/// is established. That is, until the [`state_changed`] callback of your
/// `SecureSessionTransport` tells you that the connection is `Established`, or until
/// [`is_established`] on this Secure Session returns `true`, or until [`negotiate`]
/// returns an empty message.
///
/// [`negotiate`]: struct.SecureSession.html#method.negotiate
/// [`state_changed`]: trait.SecureSessionTransport.html#method.state_changed
/// [`is_established`]: struct.SecureSession.html#method.is_established
Initiates connection to the remote peer, returns connection message.
This is the first method to call. It returns you a message that you must somehow
transfer to the remote peer and give it to its [`negotiate`] method. This results in
another message which must be transferred back to this Secure Session and passed to
its [`negotiate`] method. Continue passing these message around until the connection
is established.


Initiates connection to the remote peer returns connection message . This is the first method to call . It returns you a message that you must somehow transfer to the remote peer and give it to its [ ` negotiate ` ] method . This results in another message which must be transferred back to this Secure Session and passed to its [ ` negotiate ` ] method . Continue passing these message around until the connection is established .
pub fn generate_connect_request(&mut self) -> Result<Vec<u8>> {
        let mut output = Vec::new();
        let mut output_len = 0;
        unsafe {
            let status = secure_session_generate_connect_request(
                self.session_ctx,
                ptr::null_mut(),
                &mut output_len,
            );
            let error = Error::from_session_status(status);
            if error.kind() != ErrorKind::BufferTooSmall {
                return Err(error);
            }
        }
        output.reserve(output_len);
        unsafe {
            let status = secure_session_generate_connect_request(
                self.session_ctx,
                output.as_mut_ptr() as *mut c_void,
                &mut output_len,
            );
            let error = Error::from_session_status(status);
            if error.kind() != ErrorKind::Success {
                return Err(error);
            }
            debug_assert!(output_len <= output.capacity());
            output.set_len(output_len);
        }
        Ok(output)
    }
pub fn generate_connect_request ( & mut self ) -> Result < Vec < u8 > > { let mut output = Vec :: new ( ) ; let mut output_len = 0 ; unsafe { let status = secure_session_generate_connect_request ( self . session_ctx , ptr :: null_mut ( ) , & mut output_len , ) ; let error = Error :: from_session_status ( status ) ; if error . kind ( ) != ErrorKind :: BufferTooSmall { return Err ( error ) ; } } output . reserve ( output_len ) ; unsafe { let status = secure_session_generate_connect_request ( self . session_ctx , output . as_mut_ptr ( ) as * mut c_void , & mut output_len , ) ; let error = Error :: from_session_status ( status ) ; if error . kind ( ) != ErrorKind :: Success { return Err ( error ) ; } debug_assert ! ( output_len output capacity ( ) ) ; output . set_len ( output_len ) ; } Ok ( output ) }
Initiates connection to the remote peer, returns connection message.
Initiates connection to the remote peer returns connection message .
&mut self
&mut self