pub enum ResourceError {
OutOfBudget {
requested: usize,
current: usize,
remaining: usize,
limit: usize,
},
Driver(String),
StreamMisuse(String),
UseAfterFree {
generation: Generation,
},
OutOfBounds {
generation: Generation,
},
}Expand description
Errors returned by resource implementations. Distinct variants for the cases stress tests need to pin (out-of-budget vs CUDA driver failure vs use-after-free etc.).
Variants§
OutOfBudget
The requested allocation would exceed the resource’s budget. Carries the exact accounting state captured at the rejecting decision point so callers can report cumulative pressure.
Driver(String)
CUDA driver returned an error. Carries the wrapped message.
StreamMisuse(String)
A stream-ordered contract was violated (e.g. dealloc on a stream that does not match the alloc stream without an intervening sync).
UseAfterFree
A debug-guard or logging adaptor detected a use-after-free or double-free. Hard error in debug builds; surfaced upward.
Fields
generation: GenerationOutOfBounds
A debug-guard adaptor detected an out-of-bounds write past a canary boundary.
Fields
generation: GenerationTrait Implementations§
Source§impl Debug for ResourceError
impl Debug for ResourceError
Source§impl Display for ResourceError
impl Display for ResourceError
Source§impl Error for ResourceError
impl Error for ResourceError
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()