pub struct InboundRequestContext { /* private fields */ }Expand description
Sanitized, immutable ingress facts for one server dispatch.
The type intentionally has no Clone, Serialize, or Debug
implementation. In particular, it offers no channel for raw headers or
credentials. A native transport may retain its singleton authorization
field in crate-private custody for server admission, but it never exposes
that field through this public context. The server creates a fresh
request-scoped McpContext from these facts for every dispatch.
Implementations§
Source§impl InboundRequestContext
impl InboundRequestContext
Sourcepub fn new(cx: Cx, request_id: u64, transport: InboundRequestTransport) -> Self
pub fn new(cx: Cx, request_id: u64, transport: InboundRequestTransport) -> Self
Creates sanitized facts after transport metadata validation has completed.
Sourcepub const fn transport(&self) -> InboundRequestTransport
pub const fn transport(&self) -> InboundRequestTransport
Returns the transport’s allowlisted provenance fact.
Sourcepub const fn request_id(&self) -> u64
pub const fn request_id(&self) -> u64
Returns the request identity selected by the transport.
Auto Trait Implementations§
impl !RefUnwindSafe for InboundRequestContext
impl !UnwindSafe for InboundRequestContext
impl Freeze for InboundRequestContext
impl Send for InboundRequestContext
impl Sync for InboundRequestContext
impl Unpin for InboundRequestContext
impl UnsafeUnpin for InboundRequestContext
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).