pub struct InboundEvent(pub Event);Expand description
The inbound (client-signed) Nostr event for the current request.
Injected into a request’s rmcp extensions typemap by
NostrServerWorker alongside
ClientPubkey, so a tool, resource, or prompt handler can read the full
signed event — its id, pubkey, sig, … — to bind a tool call to the
publishing event, store it for later return, or audit it:
use contextvm_sdk::transport::server::InboundEvent;
use rmcp::service::RequestContext;
use rmcp::RoleServer;
if let Some(ev) = ctx.extensions.get::<InboundEvent>() {
let sig_hex = ev.0.sig.to_string(); // Schnorr signature, hex
// …
}For gift-wrapped requests this is the inner, signature-verified event
(the same one whose pubkey is surfaced as ClientPubkey, so ev.0.pubkey
and ClientPubkey agree by construction). For plaintext requests it is the
outer request event. For CEP-22 oversized requests it is the carrying end
frame’s event (a notifications/progress event signed by the client whose
id is the correlation id) — the request was chunked, so no single dedicated
request event exists. It is injected only for real client requests; synthetic
transport-internal requests (announcement / initialization drives) carry no
event, so extensions.get::<InboundEvent>() returns None for them. This is
purely a local affordance — it is never
serialized onto the wire. The event id is also reachable as the rmcp request
id (ctx.id); this type additionally exposes sig, which the server cannot
reconstruct without the client’s private key.
Tuple Fields§
§0: EventTrait Implementations§
Source§impl Clone for InboundEvent
impl Clone for InboundEvent
Source§fn clone(&self) -> InboundEvent
fn clone(&self) -> InboundEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !Freeze for InboundEvent
impl RefUnwindSafe for InboundEvent
impl Send for InboundEvent
impl Sync for InboundEvent
impl Unpin for InboundEvent
impl UnsafeUnpin for InboundEvent
impl UnwindSafe for InboundEvent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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