pub trait Peer: Send + Sync {
// Required method
fn notify(
&self,
notification: Notification,
) -> Pin<Box<dyn Future<Output = Result<(), McpError>> + Send + '_>>;
}Expand description
Trait for sending messages to the peer (client or server).
This trait abstracts over the transport layer, allowing the context to send notifications without knowing the underlying transport.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".