pub struct StreamReader { /* private fields */ }Expand description
A cursor over one live output stream. StreamReader::next blocks up to a
timeout for the next chunk.
Implementations§
Source§impl StreamReader
impl StreamReader
Sourcepub fn next(&mut self, timeout: Duration) -> ReadStep
pub fn next(&mut self, timeout: Duration) -> ReadStep
Block up to timeout for the next step: the next retained chunk, Eof
once the stream is closed and fully drained, or Pending if nothing new
arrived in time.
Sourcepub fn try_next(&mut self) -> Option<Vec<u8>>
pub fn try_next(&mut self) -> Option<Vec<u8>>
The next retained chunk if one is already buffered, without blocking.
None means the ring is momentarily drained (not that the stream
ended); callers batch-draining an interactive stream use it to flush
several chunks in one write.
Sourcepub fn took_drop(&mut self) -> bool
pub fn took_drop(&mut self) -> bool
Whether the ring evicted output this reader had not yet consumed since
the last call, clearing the flag. An interactive consumer uses it to
trigger a screen repaint (ExecProcess::resync) after falling behind.
Sourcepub fn took_reset(&mut self) -> bool
pub fn took_reset(&mut self) -> bool
Whether the ring was reset to a repaint (a Snapshot superseded the stream) since the last call, clearing the flag. An interactive consumer drops any stale terminal-local backlog on this so the repaint it is about to read renders at once instead of stuck behind bytes the terminal will never finish draining.
Auto Trait Implementations§
impl !RefUnwindSafe for StreamReader
impl !UnwindSafe for StreamReader
impl Freeze for StreamReader
impl Send for StreamReader
impl Sync for StreamReader
impl Unpin for StreamReader
impl UnsafeUnpin for StreamReader
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request