pub struct RequestContext {
pub method: String,
pub path: String,
pub hostname: String,
pub headers: Vec<(String, String)>,
pub query_string: String,
pub peer_ip: Option<String>,
pub tenant_id: Option<String>,
pub site_id: Option<String>,
pub extensions: HashMap<String, String>,
}Expand description
Request context passed to middleware plugins.
Pure data — no framework types. Middleware can read request metadata
and write to extensions to pass data between on_request and
on_response, or to downstream handlers.
Fields§
§method: String§path: String§hostname: String§headers: Vec<(String, String)>§query_string: String§peer_ip: Option<String>§tenant_id: Option<String>§site_id: Option<String>§extensions: HashMap<String, String>Mutable key-value store for passing plugin data through the
request lifecycle. Middleware plugins can write here in on_request
and read in on_response. Other plugins/handlers can also read.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RequestContext
impl RefUnwindSafe for RequestContext
impl Send for RequestContext
impl Sync for RequestContext
impl Unpin for RequestContext
impl UnsafeUnpin for RequestContext
impl UnwindSafe for RequestContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more