pub mod http;
pub mod stdio;
use crate::error::FastMCPError;
use crate::mcp::types::{JsonRpcRequest, JsonRpcResponse};
use async_trait::async_trait;
use std::sync::Arc;
#[async_trait]
pub trait RequestHandler: Send + Sync {
async fn handle_request(
&self,
request: JsonRpcRequest,
) -> Result<JsonRpcResponse, FastMCPError>;
async fn handle_notification(
&self,
notification: crate::mcp::types::JsonRpcNotification,
) -> Result<(), FastMCPError>;
}
#[async_trait]
pub trait Transport: Send + Sync {
async fn start(
&self,
handler: Arc<dyn RequestHandler>,
outbound_rx: Option<tokio::sync::broadcast::Receiver<crate::mcp::types::JsonRpcMessage>>,
) -> Result<(), FastMCPError>;
}