transport.rs
1pub mod http;
2mod stdio_transport;
3
4use anyhow::Result;
5use async_trait::async_trait;
6use futures::Stream;
7use std::pin::Pin;
8
9pub use http::*;
10pub use stdio_transport::*;
11
12#[async_trait]
13pub trait Transport: Send + Sync {
14 async fn send(&self, message: String) -> Result<()>;
15 fn receive(&self) -> Pin<Box<dyn Stream<Item = String> + Send>>;
16 fn receive_err(&self) -> Pin<Box<dyn Stream<Item = String> + Send>>;
17}