pub struct OutputReceiver { /* private fields */ }Expand description
Ergonomic wrapper around a broadcast receiver of process output.
Implementations§
Source§impl OutputReceiver
impl OutputReceiver
pub fn new(rx: Receiver<OutputChunk>) -> Self
Sourcepub async fn recv(&mut self) -> Option<OutputChunk>
pub async fn recv(&mut self) -> Option<OutputChunk>
Receive the next available chunk, skipping lagged messages.
Sourcepub fn try_drain(&mut self) -> Vec<OutputChunk>
pub fn try_drain(&mut self) -> Vec<OutputChunk>
Drain all immediately available chunks without blocking.
Sourcepub fn drain_into(&mut self, buf: &mut HeadTailBuffer)
pub fn drain_into(&mut self, buf: &mut HeadTailBuffer)
Drain all immediately available chunks into a buffer, merging streams.
Trait Implementations§
Source§impl From<Receiver<OutputChunk>> for OutputReceiver
impl From<Receiver<OutputChunk>> for OutputReceiver
Source§fn from(rx: Receiver<OutputChunk>) -> Self
fn from(rx: Receiver<OutputChunk>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for OutputReceiver
impl RefUnwindSafe for OutputReceiver
impl Send for OutputReceiver
impl Sync for OutputReceiver
impl Unpin for OutputReceiver
impl UnsafeUnpin for OutputReceiver
impl UnwindSafe for OutputReceiver
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