pub struct RequestParts {
pub method: HttpMethod,
pub path: String,
pub scheme: Option<String>,
pub host: Option<String>,
pub peer_addr: Option<SocketAddr>,
}Expand description
An owned snapshot of the raw request parts, taken before the handler runs.
The parts are read borrowed from the adapter’s receive buffer through
HttpRequestParts and copied once here, because an async handler’s
future outlives the borrow. scheme and host are the effective values
after any trusted proxy middleware, matching what ConnectionInfo reports.
The snapshot is HTTP’s: extracting it on a transport that carries no
request line — an MCP tool call — rejects deterministically with
transport_mismatch instead of inventing values.
Fields§
§method: HttpMethod§path: String§scheme: Option<String>§host: Option<String>§peer_addr: Option<SocketAddr>Trait Implementations§
Source§impl Clone for RequestParts
impl Clone for RequestParts
Source§fn clone(&self) -> RequestParts
fn clone(&self) -> RequestParts
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RequestParts
impl Debug for RequestParts
impl Eq for RequestParts
Source§impl FromInvocation for RequestParts
impl FromInvocation for RequestParts
Source§fn from_invocation(
input: &InvocationInput<'_>,
_name: &str,
_required: bool,
) -> Result<Self, InputRejection>
fn from_invocation( input: &InvocationInput<'_>, _name: &str, _required: bool, ) -> Result<Self, InputRejection>
Extracts one handler argument. Read more
Source§impl PartialEq for RequestParts
impl PartialEq for RequestParts
impl StructuralPartialEq for RequestParts
Auto Trait Implementations§
impl Freeze for RequestParts
impl RefUnwindSafe for RequestParts
impl Send for RequestParts
impl Sync for RequestParts
impl Unpin for RequestParts
impl UnsafeUnpin for RequestParts
impl UnwindSafe for RequestParts
Blanket Implementations§
Source§impl<T> BackgroundExt for T
impl<T> BackgroundExt for T
fn background(self, task: BackgroundTask) -> Background<Self>
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