#[non_exhaustive]pub struct Demand {
pub want_bytes: usize,
pub saturated: bool,
}Expand description
A stage’s hint about how much more input it can usefully accept right now.
This is advisory backpressure, not enforcement: a driver may call
Stage::feed with more than want_bytes, or while saturated is true,
and a well-behaved stage must still handle it correctly (buffering,
erroring, or blocking as its own contract dictates) — Demand only lets a
cooperative driver avoid doing so needlessly.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.want_bytes: usizeHow many more bytes this stage would like handed to Stage::feed
before it is called again. 0 carries no meaning beyond “no
particular preference”; it is not a demand for zero bytes.
saturated: booltrue if the stage is currently full and would prefer not to receive
more input until it has been polled / has had time to drain.
Implementations§
Trait Implementations§
impl Copy for Demand
impl Eq for Demand
impl StructuralPartialEq for Demand
Auto Trait Implementations§
impl Freeze for Demand
impl RefUnwindSafe for Demand
impl Send for Demand
impl Sync for Demand
impl Unpin for Demand
impl UnsafeUnpin for Demand
impl UnwindSafe for Demand
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