pub enum ResourceError {
OutOfBudget {
requested: usize,
remaining: 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 requested bytes and the remaining budget so tests can assert deterministic refusal.
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)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for ResourceError
impl RefUnwindSafe for ResourceError
impl Send for ResourceError
impl Sync for ResourceError
impl Unpin for ResourceError
impl UnsafeUnpin for ResourceError
impl UnwindSafe for ResourceError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more