pub struct ClientPubkey(pub String);Expand description
The Nostr public key (hex) of the client that issued the current request.
NostrServerWorker injects this
into every inbound request’s rmcp extensions typemap, so a tool, resource,
or prompt handler can identify its caller:
ⓘ
use contextvm_sdk::transport::server::ClientPubkey;
use rmcp::service::RequestContext;
use rmcp::RoleServer;
let caller = ctx.extensions.get::<ClientPubkey>().map(|c| c.0.clone());The value is the raw hex pubkey (the same string as
IncomingRequest::client_pubkey). It is present on every real inbound
request, unlike OpenStreamWriter, which is injected only for open-stream
tools/call calls. This is purely a local affordance — it is never
serialized onto the wire. The inbound Nostr event id is available separately
as the rmcp request id (ctx.id), which the worker rewrites to the event id.
Tuple Fields§
§0: StringTrait Implementations§
Source§impl Clone for ClientPubkey
impl Clone for ClientPubkey
Source§fn clone(&self) -> ClientPubkey
fn clone(&self) -> ClientPubkey
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 moreAuto Trait Implementations§
impl Freeze for ClientPubkey
impl RefUnwindSafe for ClientPubkey
impl Send for ClientPubkey
impl Sync for ClientPubkey
impl Unpin for ClientPubkey
impl UnsafeUnpin for ClientPubkey
impl UnwindSafe for ClientPubkey
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> 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>
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