pub struct StdioTransport { /* private fields */ }Expand description
Line-based message framing for stdio transport
Implementations§
Source§impl StdioTransport
impl StdioTransport
Sourcepub fn with_config(config: StdioConfig) -> Self
pub fn with_config(config: StdioConfig) -> Self
Create with custom configuration
Sourcepub fn with_auto_flush(self, auto_flush: bool) -> Self
pub fn with_auto_flush(self, auto_flush: bool) -> Self
Set auto-flush behavior
Sourcepub fn shutdown_handle(&self) -> Arc<AtomicBool>
pub fn shutdown_handle(&self) -> Arc<AtomicBool>
Get shutdown handle for external shutdown signaling
Sourcepub fn is_shutdown(&self) -> bool
pub fn is_shutdown(&self) -> bool
Check if shutdown was signaled
Sourcepub fn read_message<R: BufRead>(
&mut self,
reader: &mut R,
) -> Result<Option<String>>
pub fn read_message<R: BufRead>( &mut self, reader: &mut R, ) -> Result<Option<String>>
Read a single JSON-RPC message from stdin
Sourcepub fn write_message<W: Write>(
&self,
writer: &mut W,
message: &str,
) -> Result<()>
pub fn write_message<W: Write>( &self, writer: &mut W, message: &str, ) -> Result<()>
Write a JSON-RPC message to stdout
Sourcepub fn read_all_messages<R: BufRead>(
&mut self,
reader: &mut R,
) -> Result<Vec<String>>
pub fn read_all_messages<R: BufRead>( &mut self, reader: &mut R, ) -> Result<Vec<String>>
Read messages from stdin until EOF or shutdown
Sourcepub fn log_stderr(&self, message: &str)
pub fn log_stderr(&self, message: &str)
Log a diagnostic message to stderr
Sourcepub fn format_log_line(prefix: &str, message: &str) -> String
pub fn format_log_line(prefix: &str, message: &str) -> String
Format a sanitized diagnostic log line.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StdioTransport
impl RefUnwindSafe for StdioTransport
impl Send for StdioTransport
impl Sync for StdioTransport
impl Unpin for StdioTransport
impl UnsafeUnpin for StdioTransport
impl UnwindSafe for StdioTransport
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