pub struct Protocol;Expand description
Protocol handler for Claude Code JSON lines communication
Implementations§
Source§impl Protocol
impl Protocol
Sourcepub async fn write_async<W: AsyncWriteExt + Unpin, T: Serialize>(
writer: &mut W,
message: &T,
) -> Result<()>
pub async fn write_async<W: AsyncWriteExt + Unpin, T: Serialize>( writer: &mut W, message: &T, ) -> Result<()>
Write a message to an async writer
Sourcepub async fn read_async<R: AsyncBufReadExt + Unpin, T: for<'de> Deserialize<'de>>(
reader: &mut R,
) -> Result<T>
pub async fn read_async<R: AsyncBufReadExt + Unpin, T: for<'de> Deserialize<'de>>( reader: &mut R, ) -> Result<T>
Read a message from an async reader
Auto Trait Implementations§
impl Freeze for Protocol
impl RefUnwindSafe for Protocol
impl Send for Protocol
impl Sync for Protocol
impl Unpin for Protocol
impl UnwindSafe for Protocol
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