libnghttp2_sys

Type Alias nghttp2_select_padding_callback

Source
pub type nghttp2_select_padding_callback = Option<unsafe extern "C" fn(session: *mut nghttp2_session, frame: *const nghttp2_frame, max_payloadlen: usize, user_data: *mut c_void) -> isize>;
Expand description

@functypedef

Callback function invoked when the library asks application how many padding bytes are required for the transmission of the |frame|. The application must choose the total length of payload including padded bytes in range [frame->hd.length, max_payloadlen], inclusive. Choosing number not in this range will be treated as :enum:NGHTTP2_ERR_CALLBACK_FAILURE. Returning frame->hd.length means no padding is added. Returning :enum:NGHTTP2_ERR_CALLBACK_FAILURE will make nghttp2_session_send() and nghttp2_session_mem_send() functions immediately return :enum:NGHTTP2_ERR_CALLBACK_FAILURE.

To set this callback to :type:nghttp2_session_callbacks, use nghttp2_session_callbacks_set_select_padding_callback().

Aliased Type§

enum nghttp2_select_padding_callback {
    None,
    Some(unsafe extern "C" fn(_: *mut nghttp2_session, _: *const nghttp2_frame, _: usize, _: *mut c_void) -> isize),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn(_: *mut nghttp2_session, _: *const nghttp2_frame, _: usize, _: *mut c_void) -> isize)

Some value of type T.