pub type mbedtls_ssl_recv_timeout_t = Option<unsafe extern "C" fn(ctx: *mut c_void, buf: *mut c_uchar, len: usize, timeout: u32) -> c_int>;
Expand description

\brief Callback type: receive data from the network, with timeout

\note That callback must block until data is received, or the timeout delay expires, or the operation is interrupted by a signal.

\param ctx Context for the receive callback (typically a file descriptor) \param buf Buffer to write the received data to \param len Length of the receive buffer \param timeout Maximum number of milliseconds to wait for data 0 means no timeout (potentially waiting forever)

\return The callback must return the number of bytes received, or a non-zero error code: \c MBEDTLS_ERR_SSL_TIMEOUT if the operation timed out, \c MBEDTLS_ERR_SSL_WANT_READ if interrupted by a signal.

\note The callback may receive fewer bytes than the length of the buffer. It must always return the number of bytes actually received and written to the buffer.

Aliased Type§

enum mbedtls_ssl_recv_timeout_t {
    None,
    Some(unsafe extern "C" fn(_: *mut c_void, _: *mut u8, _: usize, _: u32) -> i32),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn(_: *mut c_void, _: *mut u8, _: usize, _: u32) -> i32)

Some value of type T.