#[non_exhaustive]pub enum Error {
Show 20 variants
InvalidBounds {
min: Level,
max: Level,
},
BudgetExhausted {
limit: usize,
},
BeforeStart {
at: Tick,
start: Tick,
},
EmptyInterval {
start: Tick,
end: Tick,
},
NonPositiveAmount {
amount: Level,
},
KindMismatch,
Overflow,
OutOfMemory,
CapacityExceeded {
container: Container,
capacity: usize,
},
InvalidWindow {
earliest: Tick,
latest: Tick,
},
BufferTooSmall {
needed: usize,
},
Malformed,
ChecksumMismatch,
UnsupportedVersion {
version: u8,
},
InvalidStep {
step: Tick,
},
UnknownResource,
UnknownActivity {
activity: ActivityId,
},
InconsistentPrecedences,
NegativeDuration {
shortest: Tick,
},
SearchExhausted {
checks: usize,
},
}Expand description
Why a timeline could not be built, an impact was rejected, or a check could not finish.
None of these is a resource violation. A violation is a successful check result, see
Violation.
The enum is #[non_exhaustive]: new failure modes (for example of future checks) are added
without a breaking release, so a match needs a wildcard arm. Callers that only need the
distinction “retry with more room” versus “malformed input” can use
is_capacity.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidBounds
The lower bound is greater than the upper bound, or a claimable capacity is negative.
BudgetExhausted
The timeline already holds as many impacts as its budget allows.
BeforeStart
An impact starts before the timeline start.
EmptyInterval
A claim or rate interval [start, end) is empty or inverted.
NonPositiveAmount
A claim amount is zero or negative.
KindMismatch
A step or rate impact was added to a claimable timeline, which accepts claims only.
Overflow
An intermediate sum, or the level at the first violation, does not fit the number range.
OutOfMemory
Memory for the impact list or the check could not be allocated.
CapacityExceeded
A fixed-capacity container is full.
Only fixed-capacity storage (Fixed,
FixedPlan) reports this; heap storage reports
OutOfMemory instead. The operation that failed left its target
unchanged.
Fields
InvalidWindow
A start window has earliest > latest.
BufferTooSmall
An output buffer is too short for an encoding.
Malformed
Encoded bytes have the wrong magic, length or content.
ChecksumMismatch
Encoded bytes do not match their checksum.
UnsupportedVersion
Encoded bytes use a format version this build does not read.
InvalidStep
A sampling step is zero or negative.
UnknownResource
A demand names a timeline that is not part of the plan.
UnknownActivity
A precedence names an activity that is not part of the envelope.
Fields
activity: ActivityIdThe unknown activity.
InconsistentPrecedences
The start windows and precedences of an envelope admit no schedule at all.
NegativeDuration
A duration range of an activity starts below zero.
SearchExhausted
A search ran out of its caller-chosen number of candidate checks before it found an answer.
Implementations§
Source§impl Error
impl Error
Sourcepub const fn is_capacity(&self) -> bool
pub const fn is_capacity(&self) -> bool
Whether the error means “no room”: OutOfMemory,
CapacityExceeded or BudgetExhausted.
These depend on the chosen limits, not on the input being malformed, so a caller may retry with larger limits or shed load.
Trait Implementations§
impl Copy for Error
impl Eq for Error
Source§impl Error for Error
impl Error for Error
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()