esp_idf_hal::sys

Type Alias httpd_uri_t

Source
pub type httpd_uri_t = httpd_uri;
Expand description

@brief Structure for URI handler

Aliased Type§

struct httpd_uri_t {
    pub uri: *const u8,
    pub method: u32,
    pub handler: Option<unsafe extern "C" fn(_: *mut httpd_req) -> i32>,
    pub user_ctx: *mut c_void,
    pub is_websocket: bool,
    pub handle_ws_control_frames: bool,
    pub supported_subprotocol: *const u8,
}

Fields§

§uri: *const u8

< The URI to handle

§method: u32

< Method supported by the URI

§handler: Option<unsafe extern "C" fn(_: *mut httpd_req) -> i32>

Handler to call for supported request method. This must return ESP_OK, or else the underlying socket will be closed.

§user_ctx: *mut c_void

Pointer to user context data which will be available to handler

§is_websocket: bool

Flag for indicating a WebSocket endpoint. If this flag is true, then method must be HTTP_GET. Otherwise the handshake will not be handled.

§handle_ws_control_frames: bool

Flag indicating that control frames (PING, PONG, CLOSE) are also passed to the handler This is used if a custom processing of the control frames is needed

§supported_subprotocol: *const u8

Pointer to subprotocol supported by URI

Trait Implementations

Source§

impl Clone for httpd_uri

Source§

fn clone(&self) -> httpd_uri

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for httpd_uri

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for httpd_uri

Source§

fn default() -> httpd_uri

Returns the “default value” for a type. Read more
Source§

impl Copy for httpd_uri