pub fn receive(&mut self, max_len: usize) -> Result<Vec<u8>> {
        let mut message = Vec::with_capacity(max_len);

        unsafe {
            let length = secure_session_receive(
                self.session_ctx,
                message.as_mut_ptr() as *mut c_void,
                message.capacity(),
            );
            if length <= 21 {
                return Err(Error::from_session_status(length as themis_status_t));
            }
            debug_assert!(length as usize <= message.capacity());
            message.set_len(length as usize);
        }

        Ok(message)
    }
/// Receives a message from the remote peer.
///
/// Maximum length of the message is specified by the parameter. The message will be truncated
/// to this length if the peer sends something larger.
///
/// This method will fail if a secure connection has not been established yet.
///
/// This method is a part of transport API and requires [`receive_data`] method of
/// `SecureSessionTransport`.
///
/// [`receive_data`]: trait.SecureSessionTransport.html#method.receive_data
Receives a message from the remote peer.
Maximum length of the message is specified by the parameter. The message will be truncated
to this length if the peer sends something larger.

This method will fail if a secure connection has not been established yet.

This method is a part of transport API and requires [`receive_data`] method of
`SecureSessionTransport`.


Receives a message from the remote peer . Maximum length of the message is specified by the parameter . The message will be truncated to this length if the peer sends something larger . This method will fail if a secure connection has not been established yet . This method is a part of transport API and requires [ ` receive_data ` ] method of ` SecureSessionTransport ` .
pub fn receive(&mut self, max_len: usize) -> Result<Vec<u8>> {
        let mut message = Vec::with_capacity(max_len);
        unsafe {
            let length = secure_session_receive(
                self.session_ctx,
                message.as_mut_ptr() as *mut c_void,
                message.capacity(),
            );
            if length <= 21 {
                return Err(Error::from_session_status(length as themis_status_t));
            }
            debug_assert!(length as usize <= message.capacity());
            message.set_len(length as usize);
        }
        Ok(message)
    }
pub fn receive ( & mut self , max_len : usize ) -> Result < Vec < u8 > > { let mut message = Vec :: with_capacity ( max_len ) ; unsafe { let length = secure_session_receive ( self . session_ctx , message . as_mut_ptr ( ) as * mut c_void , message . capacity ( ) , ) ; if length <= 21 { return Err ( Error :: from_session_status ( length as themis_status_t ) ) ; } debug_assert ! ( length as usize message capacity ( ) ) ; message . set_len ( length as usize ) ; } Ok ( message ) }
Receives a message from the remote peer.
Receives a message from the remote peer .
&mut self
max_len
usize
&mut self
max_len
usize