RequestParts

Trait RequestParts 

Source
pub trait RequestParts: Send + Sync {
    // Required methods
    fn authorization_header(&self) -> Option<&str>;
    fn get_header(&self, name: &str) -> Option<&str>;
    fn method(&self) -> Option<&str>;
    fn uri(&self) -> Option<&str>;

    // Provided method
    fn bearer_token(&self) -> Option<&str> { ... }
}
Expand description

Trait for extracting authentication-relevant data from requests

Required Methods§

Source

fn authorization_header(&self) -> Option<&str>

Extract Authorization header as string

Source

fn get_header(&self, name: &str) -> Option<&str>

Get custom header value by name

Source

fn method(&self) -> Option<&str>

Get request method (if applicable)

Source

fn uri(&self) -> Option<&str>

Get request URI (if applicable)

Provided Methods§

Source

fn bearer_token(&self) -> Option<&str>

Extract Bearer token from Authorization header

Implementors§