pub trait ResourceReader: Send + Sync {
// Required method
fn read_resource(
&self,
cx: &Cx,
uri: &str,
depth: u32,
) -> Pin<Box<dyn Future<Output = McpResult<ResourceReadResult>> + Send + '_>>;
}Expand description
Trait for reading resources from within handlers.
This trait is implemented by the server’s Router to allow tools, resources, and prompts to read other resources. It enables cross-component composition and code reuse.
The trait uses boxed futures to avoid complex lifetime issues with async traits.