libnghttp2_sys

Type Alias nghttp2_on_header_callback2

Source
pub type nghttp2_on_header_callback2 = Option<unsafe extern "C" fn(session: *mut nghttp2_session, frame: *const nghttp2_frame, name: *mut nghttp2_rcbuf, value: *mut nghttp2_rcbuf, flags: u8, user_data: *mut c_void) -> c_int>;
Expand description

@functypedef

Callback function invoked when a header name/value pair is received for the |frame|. The |name| is header name. The |value| is header value. The |flags| is bitwise OR of one or more of :type:nghttp2_nv_flag.

This callback behaves like :type:nghttp2_on_header_callback, except that |name| and |value| are stored in reference counted buffer. If application wishes to keep these references without copying them, use nghttp2_rcbuf_incref() to increment their reference count. It is the application’s responsibility to call nghttp2_rcbuf_decref() if they called nghttp2_rcbuf_incref() so as not to leak memory. If the |session| is created by nghttp2_session_server_new3() or nghttp2_session_client_new3(), the function to free memory is the one belongs to the mem parameter. As long as this free function alives, |name| and |value| can live after |session| was destroyed.

Aliased Type§

enum nghttp2_on_header_callback2 {
    None,
    Some(unsafe extern "C" fn(_: *mut nghttp2_session, _: *const nghttp2_frame, _: *mut nghttp2_rcbuf, _: *mut nghttp2_rcbuf, _: u8, _: *mut c_void) -> i32),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn(_: *mut nghttp2_session, _: *const nghttp2_frame, _: *mut nghttp2_rcbuf, _: *mut nghttp2_rcbuf, _: u8, _: *mut c_void) -> i32)

Some value of type T.