pub struct ClientSubscription { /* private fields */ }Expand description
Client-side handle for a long-lived subscriptions/listen request.
Implementations§
Source§impl ClientSubscription
impl ClientSubscription
pub fn new( id: Value, notifications: UnboundedReceiver<JsonRpcNotification>, completion: Receiver<McpResult<JsonRpcResponse>>, ) -> Self
pub fn id(&self) -> &Value
Sourcepub async fn next(&mut self) -> Option<JsonRpcNotification>
pub async fn next(&mut self) -> Option<JsonRpcNotification>
Wait for the next notification on this subscription.
Sourcepub async fn completion(&mut self) -> McpResult<JsonRpcResponse>
pub async fn completion(&mut self) -> McpResult<JsonRpcResponse>
Wait for a graceful terminal response. HTTP connection closure may instead end this channel without a response.
Trait Implementations§
Source§impl Drop for ClientSubscription
impl Drop for ClientSubscription
Auto Trait Implementations§
impl !RefUnwindSafe for ClientSubscription
impl !UnwindSafe for ClientSubscription
impl Freeze for ClientSubscription
impl Send for ClientSubscription
impl Sync for ClientSubscription
impl Unpin for ClientSubscription
impl UnsafeUnpin for ClientSubscription
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].