#[non_exhaustive]pub struct ClassRule {
pub name: String,
pub matcher: Matcher,
pub bucket: String,
pub priority: u8,
pub weight: u16,
}Expand description
A matcher plus what to do with what it matches.
#[non_exhaustive] with a Default — see the module doc for why
the pairing is required rather than stylistic. The default is an
unnamed class that claims every unit and names no bucket, so it is
always edited before use; note that a defaulted weight of zero is
rejected under Discipline::WeightedRoundRobin.
In the written form name and bucket are required and the other three
default, because the two that are required are the two whose defaults are
wrong rather than merely empty: an unnamed class collides with the next
unnamed class as ShapeError::DuplicateClassName, and a class naming no
bucket at all is ShapeError::UnknownBucket against the empty string.
Both are refusals about a key the author never wrote.
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.name: StringThe class name. Unique across the profile, and the label under which this class’s statistics are reported.
matcher: MatcherWhich units this class claims.
bucket: StringThe BucketConfig::name this class charges against. Several
classes may share one bucket, which is what makes Discipline
mean anything.
priority: u8Discipline::StrictPriority orders classes by this; higher wins.
Distinct from MoQT’s publisher_priority, which
Matcher::priority keys on: this one is the scheduler’s, and it
is always present.
weight: u16Discipline::WeightedRoundRobin shares a bucket by this. Zero is
rejected under that discipline and ignored under the other two.