#[non_exhaustive]pub struct QueueConfig {
pub depth_bytes: usize,
pub depth_objects: usize,
pub max_hold: Option<Duration>,
pub overflow: Overflow,
pub on_expiry: Expiry,
}Expand description
The per-stream queue policy: how deep, how long, and what happens at each limit.
#[non_exhaustive] with a Default — see the module doc.
The Default is hand-written, not derived: a derived one would
give depth_bytes == 0 and depth_objects == 0, which
ShapeProfile::try_new rejects as ShapeError::EmptyQueue — so
QueueConfig::default() would be a value that cannot be used, and the
..Default::default() idiom this type is built for would fail on every
profile that did not restate both depths.
That hand-written Default is also what the written form defaults every
key to, so a scenario file may omit queue entirely or name only the one
knob it cares about. It is the one config in this module where the derived
default would be the unusable value and the written default is therefore
worth having.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.depth_bytes: usizeBytes one stream’s queue may hold. Defaults to 1 MiB, matching
EgressConfig::max_pending_bytes.
depth_objects: usizeObjects one stream’s queue may hold. Defaults to 256 — a limit the byte depth does not imply, since a queue of small objects reaches neither.
max_hold: Option<Duration>Deadline for a queued object, per class. None inherits
EgressConfig::max_hold,
which is 30 s.
Pin this explicitly in any fixture that relies on a class not
delivering: under the default Expiry::Deliver a starved class
still delivers at max_hold, so an unnamed 30 s is a margin the
test inherited rather than chose.
overflow: OverflowWhat happens when the queue is full.
on_expiry: ExpiryWhat happens when a queued object outlives max_hold.
Trait Implementations§
Source§impl Clone for QueueConfig
impl Clone for QueueConfig
Source§fn clone(&self) -> QueueConfig
fn clone(&self) -> QueueConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more