File size: 554 Bytes
d90101d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | use std::io;
/// Trait for synchronized output writing.
/// Provides two output channels (primary and error) with flush support.
/// Implementors must ensure thread-safe writes.
pub trait ConsoleWriter: Send + Sync {
/// Writes bytes to primary output.
fn write(&self, buf: &[u8]) -> io::Result<usize>;
/// Writes bytes to error output.
fn write_err(&self, buf: &[u8]) -> io::Result<usize>;
/// Flushes primary output.
fn flush(&self) -> io::Result<()>;
/// Flushes error output.
fn flush_err(&self) -> io::Result<()>;
}
|