Skip to main content

extract_request_socket_address

Function extract_request_socket_address 

Source
pub fn extract_request_socket_address<B>(
    request: &Request<B>,
) -> Option<SocketAddr>
Expand description

Extract a SocketAddr stored directly in a request extension.

A request does not inherently contain this network fact. This function only reads a SocketAddr previously inserted by a server adapter or application and returns None when the extension is absent. It does not inspect forwarding Headers or establish that the value is trustworthy.