pub struct LogStream { /* private fields */ }Expand description
Implementations§
Source§impl LogStream
impl LogStream
Sourcepub fn recv(&self) -> Result<LogLine>
pub fn recv(&self) -> Result<LogLine>
Block until the next LOG line; Disconnected once the box disconnects or the stream is
closed.
Sourcepub fn try_recv(&self) -> Option<LogLine>
pub fn try_recv(&self) -> Option<LogLine>
Next buffered LOG line, or None if none is queued. Never blocks.
Sourcepub fn recv_timeout(&self, timeout: Duration) -> Option<LogLine>
pub fn recv_timeout(&self, timeout: Duration) -> Option<LogLine>
Block up to timeout for the next LOG line; None on timeout or a closed channel.
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Whether the box still delivers to this stream. Separates the two meanings of None from
Self::recv_timeout and Self::try_recv: “nothing yet” and “nothing ever again”.
Sourcepub fn try_iter(&self) -> impl Iterator<Item = LogLine> + '_
pub fn try_iter(&self) -> impl Iterator<Item = LogLine> + '_
Drain buffered LOG lines without blocking.
Sourcepub async fn recv_async(&self) -> Result<LogLine>
pub async fn recv_async(&self) -> Result<LogLine>
Await the next LOG line; runtime-agnostic (same flume channel as the sync methods).
Sourcepub fn close(&self)
pub fn close(&self)
End this stream and every clone of it. Every blocked receive returns at once, as does every
later one. Other LogStreams keep reading the queue.
For a thread that holds no handle to the stream, see Self::closer.
Sourcepub fn closer(&self) -> StreamCloser
pub fn closer(&self) -> StreamCloser
A handle that closes this stream from any thread.