use anyhow::Result;
use std::future::Future;
use std::pin::Pin;
pub trait McpTransport: Send + Sync {
fn send(&mut self, message: String) -> Pin<Box<dyn Future<Output = Result<()>> + Send + '_>>;
fn recv(&mut self) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + '_>>;
fn close(&mut self) -> Pin<Box<dyn Future<Output = Result<()>> + Send + '_>>;
}
impl McpTransport for Box<dyn McpTransport> {
fn send(&mut self, message: String) -> Pin<Box<dyn Future<Output = Result<()>> + Send + '_>> {
(**self).send(message)
}
fn recv(&mut self) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + '_>> {
(**self).recv()
}
fn close(&mut self) -> Pin<Box<dyn Future<Output = Result<()>> + Send + '_>> {
(**self).close()
}
}