pub struct McpServer { /* private fields */ }Expand description
MCP Server implementation
The main server struct that handles MCP protocol communication, manages resources, tools, and prompts, and processes client requests.
§Examples
§Basic Server Creation
use prism_mcp_rs::server::McpServer;
let server = McpServer::new("my-server".to_string(), "1.0.0".to_string());§Using ServerBuilder
use prism_mcp_rs::server::ServerBuilder;
let server = ServerBuilder::new()
.name("my-server")
.version("1.0.0")
.with_tools()
.with_resources()
.build();§Adding Tools
use prism_mcp_rs::server::McpServer;
use prism_mcp_rs::core::{Tool, ToolHandler};
use prism_mcp_rs::core::error::McpError;
use serde_json::{json, Value};
use async_trait::async_trait;
use std::collections::HashMap;
struct MyTool;
#[async_trait]
impl ToolHandler for MyTool {
async fn call(&self, _args: HashMap<String, Value>)
-> Result<prism_mcp_rs::protocol::ToolResult, McpError>
{
Ok(prism_mcp_rs::protocol::ToolResult {
content: vec![],
is_error: Some(false),
structured_content: None,
meta: None,
})
}
}
let mut server = McpServer::new("server".to_string(), "1.0.0".to_string());
// Add tool using the add_tool method directly
server.add_tool(
"my_tool",
Some("My custom tool"),
json!({}),
MyTool
).await?;Main MCP server implementation
Implementations§
Source§impl McpServer
impl McpServer
Sourcepub async fn process_message(
&self,
msg: JsonRpcMessage,
) -> McpResult<JsonRpcMessage>
pub async fn process_message( &self, msg: JsonRpcMessage, ) -> McpResult<JsonRpcMessage>
Process any JSON-RPC message asynchronously
This method handles all types of JSON-RPC messages (requests, responses, notifications, errors) and returns an appropriate response.
§Arguments
msg- The JSON-RPC message to process
§Returns
A result containing the response message or an error
§Examples
let server = McpServer::new("server".to_string(), "1.0.0".to_string());
let request = JsonRpcRequest::new(
json!(1),
"ping".to_string(),
None::<serde_json::Value>
)?;
let message = JsonRpcMessage::Request(request);
let response = server.process_message(message).await?;Sourcepub async fn handle_notification(
&self,
notification: JsonRpcNotification,
) -> McpResult<()>
pub async fn handle_notification( &self, notification: JsonRpcNotification, ) -> McpResult<()>
Sourcepub async fn handle_requests_parallel(
&self,
requests: Vec<JsonRpcRequest>,
) -> Vec<McpResult<JsonRpcResponse>> ⓘ
pub async fn handle_requests_parallel( &self, requests: Vec<JsonRpcRequest>, ) -> Vec<McpResult<JsonRpcResponse>> ⓘ
Handle multiple requests in parallel
This method processes multiple requests concurrently and returns all responses once they’re complete.
§Arguments
requests- A vector of JSON-RPC requests to process
§Returns
A vector of results, one for each request
§Examples
let server = McpServer::new("server".to_string(), "1.0.0".to_string());
let requests = vec![
JsonRpcRequest::new(json!(1), "ping".to_string(), None::<serde_json::Value>)?,
JsonRpcRequest::new(json!(2), "tools/list".to_string(), None::<serde_json::Value>)?,
];
let responses = server.handle_requests_parallel(requests).await;Sourcepub async fn handle_request_with_processor<F, Fut>(
&self,
request: JsonRpcRequest,
processor: F,
) -> McpResult<JsonRpcResponse>
pub async fn handle_request_with_processor<F, Fut>( &self, request: JsonRpcRequest, processor: F, ) -> McpResult<JsonRpcResponse>
Sourcepub async fn run_with_processor<F, Fut>(&self, _processor: F) -> McpResult<()>where
F: FnMut(JsonRpcMessage) -> Fut + Send + 'static,
Fut: Future<Output = McpResult<JsonRpcMessage>> + Send,
pub async fn run_with_processor<F, Fut>(&self, _processor: F) -> McpResult<()>where
F: FnMut(JsonRpcMessage) -> Fut + Send + 'static,
Fut: Future<Output = McpResult<JsonRpcMessage>> + Send,
Sourcepub async fn handle_request_streaming<F>(
&self,
request: JsonRpcRequest,
progress_callback: F,
) -> McpResult<JsonRpcResponse>
pub async fn handle_request_streaming<F>( &self, request: JsonRpcRequest, progress_callback: F, ) -> McpResult<JsonRpcResponse>
Sourcepub async fn handle_request_with_timeout(
&self,
request: JsonRpcRequest,
timeout_ms: u64,
) -> McpResult<JsonRpcResponse>
pub async fn handle_request_with_timeout( &self, request: JsonRpcRequest, timeout_ms: u64, ) -> McpResult<JsonRpcResponse>
Sourcepub async fn handle_request_with_retry(
&self,
request: JsonRpcRequest,
max_retries: u32,
retry_delay_ms: u64,
) -> McpResult<JsonRpcResponse>
pub async fn handle_request_with_retry( &self, request: JsonRpcRequest, max_retries: u32, retry_delay_ms: u64, ) -> McpResult<JsonRpcResponse>
Handle a request with retry logic
This method attempts to process a request with automatic retry on failure.
§Arguments
request- The request to processmax_retries- Maximum number of retry attemptsretry_delay_ms- Delay between retries in milliseconds
§Returns
The response or the last error after all retries
Sourcepub async fn process_with_middleware<M>(
&self,
message: JsonRpcMessage,
middleware: Vec<M>,
) -> McpResult<JsonRpcMessage>where
M: Fn(JsonRpcMessage) -> Pin<Box<dyn Future<Output = McpResult<JsonRpcMessage>> + Send>> + Send + Sync,
pub async fn process_with_middleware<M>(
&self,
message: JsonRpcMessage,
middleware: Vec<M>,
) -> McpResult<JsonRpcMessage>where
M: Fn(JsonRpcMessage) -> Pin<Box<dyn Future<Output = McpResult<JsonRpcMessage>> + Send>> + Send + Sync,
Source§impl McpServer
impl McpServer
Sourcepub fn new(name: String, version: String) -> Self
pub fn new(name: String, version: String) -> Self
Create a new MCP server with the given name and version
Sourcepub fn create(name: impl Into<String>, version: impl Into<String>) -> Self
pub fn create(name: impl Into<String>, version: impl Into<String>) -> Self
Create a new MCP server with ergonomic string parameters
Sourcepub fn with_config(name: String, version: String, config: ServerConfig) -> Self
pub fn with_config(name: String, version: String, config: ServerConfig) -> Self
Create a new MCP server with custom configuration
Sourcepub fn with_plugin_manager(self, manager: PluginManager) -> Self
pub fn with_plugin_manager(self, manager: PluginManager) -> Self
Attach a plugin manager to the server
Sourcepub async fn sync_plugin_tools(&self) -> McpResult<()>
pub async fn sync_plugin_tools(&self) -> McpResult<()>
Internal method to sync plugin tools with server
Sourcepub fn set_capabilities(&mut self, capabilities: ServerCapabilities)
pub fn set_capabilities(&mut self, capabilities: ServerCapabilities)
Set server capabilities
Sourcepub fn set_protocol_mode(&mut self, mode: ProtocolMode)
pub fn set_protocol_mode(&mut self, mode: ProtocolMode)
Select dual-stack, modern-only, or legacy-only server behavior.
Sourcepub fn protocol_mode(&self) -> ProtocolMode
pub fn protocol_mode(&self) -> ProtocolMode
Return the configured protocol support policy.
Sourcepub fn set_config(&mut self, config: ServerConfig)
pub fn set_config(&mut self, config: ServerConfig)
Set server configuration
Sourcepub fn set_request_policy(&mut self, policy: RequestPolicy)
pub fn set_request_policy(&mut self, policy: RequestPolicy)
Install authorization and rate-limiting controls for all requests.
Sourcepub fn with_request_policy(self, policy: RequestPolicy) -> Self
pub fn with_request_policy(self, policy: RequestPolicy) -> Self
Install authorization and rate-limiting controls using a builder style.
Sourcepub fn set_initial_resources(&mut self, resources: HashMap<String, Resource>)
pub fn set_initial_resources(&mut self, resources: HashMap<String, Resource>)
Set initial resources (used by ServerBuilder)
Sourcepub fn set_initial_tools(&mut self, tools: HashMap<String, Tool>)
pub fn set_initial_tools(&mut self, tools: HashMap<String, Tool>)
Set initial tools (used by ServerBuilder)
Sourcepub fn set_initial_prompts(&mut self, prompts: HashMap<String, Prompt>)
pub fn set_initial_prompts(&mut self, prompts: HashMap<String, Prompt>)
Set initial prompts (used by ServerBuilder)
Sourcepub fn set_initial_resource_templates(
&mut self,
templates: HashMap<String, ResourceTemplate>,
)
pub fn set_initial_resource_templates( &mut self, templates: HashMap<String, ResourceTemplate>, )
Set initial resource templates (used by ServerBuilder)
Sourcepub fn builder() -> ServerBuilder
pub fn builder() -> ServerBuilder
Create a builder for constructing servers
Sourcepub fn with_capabilities(self, capabilities: ServerCapabilities) -> Self
pub fn with_capabilities(self, capabilities: ServerCapabilities) -> Self
Configure this server with capabilities using a fluent API
Sourcepub fn with_server_config(self, config: ServerConfig) -> Self
pub fn with_server_config(self, config: ServerConfig) -> Self
Configure this server with a specific configuration (fluent API)
Sourcepub async fn add_tool<H>(
&self,
name: impl Into<String>,
description: Option<impl Into<String>>,
input_schema: Value,
handler: H,
) -> McpResult<()>where
H: ToolHandler + 'static,
pub async fn add_tool<H>(
&self,
name: impl Into<String>,
description: Option<impl Into<String>>,
input_schema: Value,
handler: H,
) -> McpResult<()>where
H: ToolHandler + 'static,
Sourcepub async fn add_multi_round_tool<H>(
&self,
name: impl Into<String>,
description: Option<impl Into<String>>,
input_schema: Value,
handler: H,
) -> McpResult<()>where
H: MultiRoundToolHandler + 'static,
pub async fn add_multi_round_tool<H>(
&self,
name: impl Into<String>,
description: Option<impl Into<String>>,
input_schema: Value,
handler: H,
) -> McpResult<()>where
H: MultiRoundToolHandler + 'static,
Add a tool that may return MCP 2026 input_required results.
Sourcepub async fn add_multi_round_tool_detailed<H>(
&self,
info: ToolInfo,
handler: H,
) -> McpResult<()>where
H: MultiRoundToolHandler + 'static,
pub async fn add_multi_round_tool_detailed<H>(
&self,
info: ToolInfo,
handler: H,
) -> McpResult<()>where
H: MultiRoundToolHandler + 'static,
Add a continuation-aware tool with a fully specified tool definition.
Sourcepub async fn add_tool_with_closure<F>(
&self,
name: impl Into<String>,
description: Option<impl Into<String>>,
input_schema: Value,
handler: F,
) -> McpResult<()>
pub async fn add_tool_with_closure<F>( &self, name: impl Into<String>, description: Option<impl Into<String>>, input_schema: Value, handler: F, ) -> McpResult<()>
Sourcepub async fn add_tool_built(&self, tool: Tool) -> McpResult<()>
pub async fn add_tool_built(&self, tool: Tool) -> McpResult<()>
Add a tool using the ToolBuilder result
Sourcepub async fn add_task_tool<H>(
&self,
info: ToolInfo,
handler: H,
) -> McpResult<()>where
H: TaskToolHandler + 'static,
pub async fn add_task_tool<H>(
&self,
info: ToolInfo,
handler: H,
) -> McpResult<()>where
H: TaskToolHandler + 'static,
Register a tool whose execution is represented by a durable SEP-2663 task.
Sourcepub async fn add_task_tool_with_fallback<H, F>(
&self,
info: ToolInfo,
handler: H,
fallback: F,
) -> McpResult<()>where
H: TaskToolHandler + 'static,
F: ToolHandler + 'static,
pub async fn add_task_tool_with_fallback<H, F>(
&self,
info: ToolInfo,
handler: H,
fallback: F,
) -> McpResult<()>where
H: TaskToolHandler + 'static,
F: ToolHandler + 'static,
Register a durable task tool plus the synchronous behavior used when a
client has not negotiated io.modelcontextprotocol/tasks.
Sourcepub async fn add_composed_task_tool<P, H>(
&self,
info: ToolInfo,
preflight: P,
handler: H,
) -> McpResult<()>where
P: MultiRoundToolHandler + 'static,
H: ComposedTaskToolHandler + 'static,
pub async fn add_composed_task_tool<P, H>(
&self,
info: ToolInfo,
preflight: P,
handler: H,
) -> McpResult<()>where
P: MultiRoundToolHandler + 'static,
H: ComposedTaskToolHandler + 'static,
Register a required-task tool that gathers request-scoped input through MCP multi-round results before creating its durable task.
The preflight handler returns InputRequired for intermediate rounds
and Complete when the durable phase may begin. Its completed value is
only a readiness signal; the composed handler produces the task result
and receives the entire final MultiRoundToolCall.
Sourcepub fn info(&self) -> &ServerInfo
pub fn info(&self) -> &ServerInfo
Get server information
Sourcepub fn capabilities(&self) -> &ServerCapabilities
pub fn capabilities(&self) -> &ServerCapabilities
Get server capabilities
Sourcepub fn config(&self) -> &ServerConfig
pub fn config(&self) -> &ServerConfig
Get server configuration
Sourcepub async fn add_resource<H>(
&self,
name: String,
uri: String,
handler: H,
) -> McpResult<()>where
H: ResourceHandler + 'static,
pub async fn add_resource<H>(
&self,
name: String,
uri: String,
handler: H,
) -> McpResult<()>where
H: ResourceHandler + 'static,
Add a resource to the server
Sourcepub async fn add_resource_detailed<H>(
&self,
info: ResourceInfo,
handler: H,
) -> McpResult<()>where
H: ResourceHandler + 'static,
pub async fn add_resource_detailed<H>(
&self,
info: ResourceInfo,
handler: H,
) -> McpResult<()>where
H: ResourceHandler + 'static,
Add a resource with detailed information
Sourcepub async fn remove_resource(&self, uri: &str) -> McpResult<bool>
pub async fn remove_resource(&self, uri: &str) -> McpResult<bool>
Remove a resource from the server
Sourcepub async fn list_resources(&self) -> McpResult<Vec<ResourceInfo>>
pub async fn list_resources(&self) -> McpResult<Vec<ResourceInfo>>
List all registered resources
Sourcepub async fn read_resource(&self, uri: &str) -> McpResult<Vec<ResourceContents>>
pub async fn read_resource(&self, uri: &str) -> McpResult<Vec<ResourceContents>>
Read a resource
Sourcepub async fn add_tool_detailed<H>(
&self,
info: ToolInfo,
handler: H,
) -> McpResult<()>where
H: ToolHandler + 'static,
pub async fn add_tool_detailed<H>(
&self,
info: ToolInfo,
handler: H,
) -> McpResult<()>where
H: ToolHandler + 'static,
Add a tool with detailed information
Sourcepub async fn remove_tool(&self, name: &str) -> McpResult<bool>
pub async fn remove_tool(&self, name: &str) -> McpResult<bool>
Remove a tool from the server
Sourcepub async fn list_tools(&self) -> McpResult<Vec<ToolInfo>>
pub async fn list_tools(&self) -> McpResult<Vec<ToolInfo>>
List all registered tools
Sourcepub async fn call_tool(
&self,
name: &str,
arguments: Option<HashMap<String, Value>>,
) -> McpResult<ToolResult>
pub async fn call_tool( &self, name: &str, arguments: Option<HashMap<String, Value>>, ) -> McpResult<ToolResult>
Call a tool
Sourcepub async fn add_prompt<H>(&self, info: PromptInfo, handler: H) -> McpResult<()>where
H: PromptHandler + 'static,
pub async fn add_prompt<H>(&self, info: PromptInfo, handler: H) -> McpResult<()>where
H: PromptHandler + 'static,
Add a prompt to the server
Sourcepub async fn remove_prompt(&self, name: &str) -> McpResult<bool>
pub async fn remove_prompt(&self, name: &str) -> McpResult<bool>
Remove a prompt from the server
Sourcepub async fn list_prompts(&self) -> McpResult<Vec<PromptInfo>>
pub async fn list_prompts(&self) -> McpResult<Vec<PromptInfo>>
List all registered prompts
Sourcepub async fn get_prompt(
&self,
name: &str,
arguments: Option<HashMap<String, Value>>,
) -> McpResult<PromptResult>
pub async fn get_prompt( &self, name: &str, arguments: Option<HashMap<String, Value>>, ) -> McpResult<PromptResult>
Get a prompt
Sourcepub async fn add_resource_template(
&self,
template: ResourceTemplate,
) -> McpResult<()>
pub async fn add_resource_template( &self, template: ResourceTemplate, ) -> McpResult<()>
Add a resource template to the server
Sourcepub async fn list_resource_templates(&self) -> McpResult<Vec<ResourceTemplate>>
pub async fn list_resource_templates(&self) -> McpResult<Vec<ResourceTemplate>>
List resource templates
Sourcepub async fn remove_resource_template(&self, name: &str) -> McpResult<bool>
pub async fn remove_resource_template(&self, name: &str) -> McpResult<bool>
Remove a resource template
Sourcepub async fn add_completion_handler<H>(
&self,
ref_type: String,
handler: H,
) -> McpResult<()>where
H: CompletionHandler + 'static,
pub async fn add_completion_handler<H>(
&self,
ref_type: String,
handler: H,
) -> McpResult<()>where
H: CompletionHandler + 'static,
Add completion handler for a specific reference type
Sourcepub async fn remove_completion_handler(&self, ref_type: &str) -> McpResult<bool>
pub async fn remove_completion_handler(&self, ref_type: &str) -> McpResult<bool>
Remove completion handler for a reference type
Sourcepub async fn handle_completion(
&self,
reference: &CompletionReference,
argument: &CompletionArgument,
context: Option<&CompletionContext>,
) -> McpResult<Vec<String>>
pub async fn handle_completion( &self, reference: &CompletionReference, argument: &CompletionArgument, context: Option<&CompletionContext>, ) -> McpResult<Vec<String>>
Handle completion request
Sourcepub async fn send_client_request(
&self,
_request: JsonRpcRequest,
) -> McpResult<JsonRpcResponse>
pub async fn send_client_request( &self, _request: JsonRpcRequest, ) -> McpResult<JsonRpcResponse>
Send a request to the client (server-initiated)
Sourcepub async fn request_sampling(
&self,
params: CreateMessageParams,
) -> McpResult<CreateMessageResult>
pub async fn request_sampling( &self, params: CreateMessageParams, ) -> McpResult<CreateMessageResult>
Request LLM sampling from client
Sourcepub async fn request_roots(&self) -> McpResult<ListRootsResult>
pub async fn request_roots(&self) -> McpResult<ListRootsResult>
Request root directories from client
Sourcepub async fn request_elicitation(
&self,
params: ElicitParams,
) -> McpResult<ElicitResult>
pub async fn request_elicitation( &self, params: ElicitParams, ) -> McpResult<ElicitResult>
Request user input via elicitation
Sourcepub async fn request_list_roots(&self) -> McpResult<ListRootsResult>
pub async fn request_list_roots(&self) -> McpResult<ListRootsResult>
Request list of roots from the client
Method allows the server to request access to specific directories or files on the client’s file system.
Sourcepub async fn notify_roots_list_changed(&self) -> McpResult<()>
pub async fn notify_roots_list_changed(&self) -> McpResult<()>
Send a notification that the roots list has changed
This notification informs the client that the list of roots the server needs access to has changed.
Sourcepub async fn notify_tools_list_changed(&self) -> McpResult<()>
pub async fn notify_tools_list_changed(&self) -> McpResult<()>
Notify active MCP 2026 subscriptions that the tool catalog changed.
Sourcepub async fn notify_prompts_list_changed(&self) -> McpResult<()>
pub async fn notify_prompts_list_changed(&self) -> McpResult<()>
Notify active MCP 2026 subscriptions that the prompt catalog changed.
Sourcepub async fn notify_resources_list_changed(&self) -> McpResult<()>
pub async fn notify_resources_list_changed(&self) -> McpResult<()>
Notify active MCP 2026 subscriptions that the resource catalog changed.
Sourcepub async fn start<T>(&mut self, transport: T) -> McpResult<()>where
T: ServerTransport + 'static,
pub async fn start<T>(&mut self, transport: T) -> McpResult<()>where
T: ServerTransport + 'static,
Start the server with the given transport
Sourcepub async fn is_running(&self) -> bool
pub async fn is_running(&self) -> bool
Check if the server is running
Sourcepub async fn state(&self) -> ServerState
pub async fn state(&self) -> ServerState
Get the current server state
Sourcepub async fn run_with_transport<T>(self, transport: T) -> McpResult<()>where
T: ServerTransport + 'static,
pub async fn run_with_transport<T>(self, transport: T) -> McpResult<()>where
T: ServerTransport + 'static,
Start server with custom transport and run until interrupted
This is a convenience method that:
- Starts the server with the provided transport
- Waits for Ctrl+C signal
- smoothly shuts down the server
§Arguments
transport- The transport to use for communication
§Example
use prism_mcp_rs::prelude::*;
#[cfg(feature = "stdio")]
use prism_mcp_rs::transport::stdio::StdioServerTransport;
#[tokio::main]
async fn main() -> McpResult<()> {
let mut server = McpServer::new("my-server".to_string(), "1.0.0".to_string());
// . add tools, resources, prompts ...
#[cfg(feature = "stdio")]
{
let transport = StdioServerTransport::new();
server.run_with_transport(transport).await?;
}
Ok(())
}Sourcepub async fn handle_request(
&self,
request: JsonRpcRequest,
) -> McpResult<JsonRpcResponse>
pub async fn handle_request( &self, request: JsonRpcRequest, ) -> McpResult<JsonRpcResponse>
Handle an incoming JSON-RPC request
Sourcepub async fn handle_request_with_context(
&self,
request: JsonRpcRequest,
context: RequestContext,
) -> McpResult<JsonRpcResponse>
pub async fn handle_request_with_context( &self, request: JsonRpcRequest, context: RequestContext, ) -> McpResult<JsonRpcResponse>
Handle a request with transport-supplied identity and correlation data.
Custom transports and authentication middleware should call this method
after validating credentials and constructing a RequestContext.
Sourcepub async fn is_initialized(&self) -> bool
pub async fn is_initialized(&self) -> bool
Check if the server has been initialized
Sourcepub async fn is_stopped(&self) -> bool
pub async fn is_stopped(&self) -> bool
Check if the server is stopping or stopped
Sourcepub async fn get_state(&self) -> ServerState
pub async fn get_state(&self) -> ServerState
Get the current server state (alias for existing state method)
Sourcepub async fn has_resources(&self) -> bool
pub async fn has_resources(&self) -> bool
Check if the server has any registered resources
Sourcepub async fn has_prompts(&self) -> bool
pub async fn has_prompts(&self) -> bool
Check if the server has any registered prompts
Sourcepub async fn tool_count(&self) -> usize
pub async fn tool_count(&self) -> usize
Get the number of registered tools
Sourcepub async fn resource_count(&self) -> usize
pub async fn resource_count(&self) -> usize
Get the number of registered resources
Sourcepub async fn prompt_count(&self) -> usize
pub async fn prompt_count(&self) -> usize
Get the number of registered prompts
Sourcepub async fn has_resource(&self, uri: &str) -> bool
pub async fn has_resource(&self, uri: &str) -> bool
Check if a specific resource is registered
Sourcepub async fn has_prompt(&self, name: &str) -> bool
pub async fn has_prompt(&self, name: &str) -> bool
Check if a specific prompt is registered
Sourcepub async fn initialize(&self) -> McpResult<()>
pub async fn initialize(&self) -> McpResult<()>
Initialize the server (sets state to Running)
Auto Trait Implementations§
impl !RefUnwindSafe for McpServer
impl !UnwindSafe for McpServer
impl Freeze for McpServer
impl Send for McpServer
impl Sync for McpServer
impl Unpin for McpServer
impl UnsafeUnpin for McpServer
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
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>
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>,
Layered].