pub struct HttpRequest {
pub method: Method,
pub path: String,
pub peer: Option<SocketAddr>,
pub query: HashMap<String, String>,
pub headers: Vec<(String, String)>,
pub body: Bytes,
pub path_params: Vec<String>,
}Fields§
§method: Method§path: String§peer: Option<SocketAddr>客户端地址(accept 时已知;解析阶段为 None)。 接入防护需要按来源 IP 限制并发与速率,所以必须一路传下来。
query: HashMap<String, String>§headers: Vec<(String, String)>§body: Bytes§path_params: Vec<String>Values captured by {name} route segments, in declaration order.
Implementations§
Trait Implementations§
Source§impl Clone for HttpRequest
impl Clone for HttpRequest
Auto Trait Implementations§
impl !Freeze for HttpRequest
impl Forget for HttpRequest
impl Move for HttpRequest
impl RefUnwindSafe for HttpRequest
impl Send for HttpRequest
impl Sync for HttpRequest
impl Unpin for HttpRequest
impl UnsafeUnpin for HttpRequestwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<(String, String)>: UnsafeUnpin,
*const u8: UnsafeUnpin,
Align8<*mut ()>: UnsafeUnpin,
&'static Vtable: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
impl UnwindSafe for HttpRequestwhere
RawVecInner: UnwindSafe,
HashMap<String, String>: UnwindSafe,
*const u8: UnwindSafe,
Align8<*mut ()>: UnwindSafe,
&'static Vtable: UnwindSafe,
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