pub enum BackpressureControl {
DropLatestIncomingIfBufferFull,
BlockUntilBufferHasSpace,
}Expand description
Controls how a single-subscriber stream reacts when its in-memory buffer fills up.
Variants§
DropLatestIncomingIfBufferFull
Drop newly read chunks whenever the in-memory buffer is full.
This keeps the stream reader moving and avoids backpressuring the child process, but a slow consumer may miss output.
BlockUntilBufferHasSpace
Wait for buffer space instead of dropping chunks.
This avoids losing output inside the library, but it can slow down stream consumption. If the child process writes faster than the consumer can keep up, the OS pipe may fill and backpressure the child process itself.
Trait Implementations§
Source§impl Clone for BackpressureControl
impl Clone for BackpressureControl
Source§fn clone(&self) -> BackpressureControl
fn clone(&self) -> BackpressureControl
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BackpressureControl
impl Debug for BackpressureControl
Source§impl PartialEq for BackpressureControl
impl PartialEq for BackpressureControl
impl Copy for BackpressureControl
impl Eq for BackpressureControl
impl StructuralPartialEq for BackpressureControl
Auto Trait Implementations§
impl Freeze for BackpressureControl
impl RefUnwindSafe for BackpressureControl
impl Send for BackpressureControl
impl Sync for BackpressureControl
impl Unpin for BackpressureControl
impl UnsafeUnpin for BackpressureControl
impl UnwindSafe for BackpressureControl
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