RequestContextExt

Trait RequestContextExt 

Source
pub trait RequestContextExt {
    // Required methods
    fn with_enhanced_client_id(self, client_id: ClientId) -> Self;
    fn extract_client_id(
        self,
        extractor: &ClientIdExtractor,
        headers: Option<&HashMap<String, String>>,
        query_params: Option<&HashMap<String, String>>,
    ) -> Self;
    fn get_enhanced_client_id(&self) -> Option<ClientId>;
}
Expand description

An extension trait for RequestContext providing enhanced client ID handling.

Required Methods§

Source

fn with_enhanced_client_id(self, client_id: ClientId) -> Self

Sets the client ID using the structured ClientId enum, which includes the method of identification.

Source

fn extract_client_id( self, extractor: &ClientIdExtractor, headers: Option<&HashMap<String, String>>, query_params: Option<&HashMap<String, String>>, ) -> Self

Extracts a client ID from headers or query parameters and sets it on the context.

Source

fn get_enhanced_client_id(&self) -> Option<ClientId>

Gets the structured ClientId enum from the context, if available.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§