pub enum BuilderError {
DuplicateDimension(Dim),
WarnNotBelowLimit(Dim),
ZeroLimit(Dim),
NoDimensions,
}Expand description
Errors returned by BudgetBuilder::build.
All variants represent structural problems with a budget declaration that the builder refuses to construct. None of these are recoverable at runtime — they indicate a bug in the caller’s declaration code.
Variants§
DuplicateDimension(Dim)
The same dimension was declared more than once. Ambiguous: which limit should win? The builder refuses to guess.
WarnNotBelowLimit(Dim)
A warn threshold was configured that equals or exceeds the dimension’s limit. A warn threshold must fire strictly before exhaustion or it serves no purpose.
ZeroLimit(Dim)
A limit of zero was configured. A zero-limit dimension can never accept any charge, which is almost certainly a bug in caller code.
NoDimensions
The builder had no dimensions declared when build was called.
An empty budget returns Verdict::Continue
for every charge, which is indistinguishable from having no
budget at all. Refuse to construct.
Trait Implementations§
Source§impl Clone for BuilderError
impl Clone for BuilderError
Source§fn clone(&self) -> BuilderError
fn clone(&self) -> BuilderError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BuilderError
impl Debug for BuilderError
Source§impl Display for BuilderError
impl Display for BuilderError
Source§impl Error for BuilderError
Available on crate feature std only.
impl Error for BuilderError
std only.1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()