pub struct RequestInfo<'a> {
pub method: &'a Method,
pub path: &'a str,
pub query: Option<&'a str>,
pub headers: &'a HeaderMap,
pub source_ip: Option<IpAddr>,
pub params: Params,
}Expand description
Parsed request metadata passed to route handlers.
Fields§
§method: &'a MethodThe HTTP method (GET, PUT, HEAD, etc.).
path: &'a strThe URL path (e.g. “/bucket/key”).
query: Option<&'a str>The raw query string, if present.
headers: &'a HeaderMapThe HTTP request headers.
source_ip: Option<IpAddr>The IP address of the client that originated this request.
Populated by runtimes that can extract client addresses (e.g. from
ConnectInfo in axum, or request headers in Lambda/Workers).
None when the source IP is unavailable or not yet extracted.
params: ParamsPath parameters extracted by the router during dispatch.
Populated by the router when a route pattern matches. Empty when the
request is constructed via RequestInfo::new.
Implementations§
Auto Trait Implementations§
impl<'a> Freeze for RequestInfo<'a>
impl<'a> RefUnwindSafe for RequestInfo<'a>
impl<'a> Send for RequestInfo<'a>
impl<'a> Sync for RequestInfo<'a>
impl<'a> Unpin for RequestInfo<'a>
impl<'a> UnsafeUnpin for RequestInfo<'a>
impl<'a> UnwindSafe for RequestInfo<'a>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more