Two-class allocation engine: contributors (configurable weight) get weighted max-min shares of the pooled capacity, leeches (receive-only, explicitly allowed) share the leftover capacity. Deterministic u128 arithmetic, validated newtypes, demo CLI in Mbit/s for the pilot Soll/Ist comparison. 19 tests, workspace clippy clean.
25 lines
722 B
Rust
25 lines
722 B
Rust
//! Error type for the fairness scheduler.
|
|
|
|
use crate::types::ParticipantId;
|
|
|
|
#[derive(Debug, thiserror::Error)]
|
|
pub enum FairnessError {
|
|
#[error("capacity must be greater than zero")]
|
|
ZeroCapacity,
|
|
|
|
#[error("invalid participant id `{0}`: expected a decimal number greater than zero")]
|
|
InvalidParticipantId(String),
|
|
|
|
#[error("demand references unknown participant {0}")]
|
|
UnknownParticipant(ParticipantId),
|
|
|
|
#[error("duplicate demand for participant {0}")]
|
|
DuplicateDemand(ParticipantId),
|
|
|
|
#[error("duplicate participant {0}")]
|
|
DuplicateParticipant(ParticipantId),
|
|
|
|
#[error("conflicting participation classes for participant {0}")]
|
|
ConflictingParticipation(ParticipantId),
|
|
}
|