pub trait PeerRequestOptionsExt {
// Required method
fn call_tool_with_options(
&self,
params: CallToolRequestParams,
options: PeerRequestOptions,
) -> impl Future<Output = Result<CallToolResult, ServiceError>> + Send;
}Expand description
Options-taking call variants for Peer<RoleClient> — the rs-side analog
of passing RequestOptions inline to the TS SDK’s client.callTool.
Without these, high-level fork calls (peer.call_tool(..) etc.) run with
PeerRequestOptions::no_options(): no timeout, infinite await. Pair
with progress_aware_options for any call whose response may be large
(CEP-22 fragments every rmcp request’s response once the peer advertises
support — rmcp stamps a progress token into every outgoing request).
For request types without a dedicated variant here, the generic path is two lines on public fork API — no wrapper needed:
let handle = peer.send_cancellable_request(request, options).await?;
let response = handle.await_response().await?;On timeout the call fails with ServiceError::Timeout { timeout } (the
value identifies which timer fired: idle vs max_total) and rmcp
publishes a notifications/cancelled for the request.
Required Methods§
Sourcefn call_tool_with_options(
&self,
params: CallToolRequestParams,
options: PeerRequestOptions,
) -> impl Future<Output = Result<CallToolResult, ServiceError>> + Send
fn call_tool_with_options( &self, params: CallToolRequestParams, options: PeerRequestOptions, ) -> impl Future<Output = Result<CallToolResult, ServiceError>> + Send
call_tool with explicit PeerRequestOptions — the direct analog of
TS client.callTool(params, schema, options).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".