pub struct LoggerStream { /* private fields */ }
Expand description
A stream bound to a socket where a source stream is captured. For example, stdout and stderr streams can be redirected to the contained socket and captured.
Implementations§
Source§impl LoggerStream
impl LoggerStream
Sourcepub fn new(socket: Socket) -> Result<LoggerStream, Status>
pub fn new(socket: Socket) -> Result<LoggerStream, Status>
Create a LoggerStream from the provided zx::Socket. The socket
object
should be bound to its intented source stream (e.g. “stdout”).
Sourcepub async fn buffer_and_drain(
self,
writer: &mut SocketLogWriter,
) -> Result<(), LogError>
pub async fn buffer_and_drain( self, writer: &mut SocketLogWriter, ) -> Result<(), LogError>
Drain the stream
and write all of its contents to writer
. Bytes are
delimited by newline and each line will be passed to writer.write
.
Sourcepub fn take_socket(self) -> Socket
pub fn take_socket(self) -> Socket
Take the underlying socket of this object.
Trait Implementations§
impl Unpin for LoggerStream
Auto Trait Implementations§
impl Freeze for LoggerStream
impl !RefUnwindSafe for LoggerStream
impl Send for LoggerStream
impl Sync for LoggerStream
impl !UnwindSafe for LoggerStream
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