pub enum IoStream {
Readable(Pin<Box<dyn AsyncRead + Send + Sync>>),
Writable(Pin<Box<dyn AsyncWrite + Send + Sync>>),
}
Expand description
Enum representing a stream that can either be readable or writable. This allows the reuse of the same traits for both MCP Server and MCP Client, where the data direction is reversed.
It encapsulates two types of I/O streams:
Readable
: A stream that implements theAsyncRead
trait for reading data asynchronously.Writable
: A stream that implements theAsyncWrite
trait for writing data asynchronously.
Variants§
Auto Trait Implementations§
impl Freeze for IoStream
impl !RefUnwindSafe for IoStream
impl Send for IoStream
impl Sync for IoStream
impl Unpin for IoStream
impl !UnwindSafe for IoStream
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more