pub enum MemoryError {
TierExhausted {
tier: &'static str,
requested: u64,
used: u64,
limit: u64,
available: u64,
role: MemoryRole,
},
InvalidRequest {
tier: &'static str,
requested: u64,
reason: &'static str,
},
AllocationFailed {
tier: &'static str,
requested: u64,
reason: String,
},
CapacityUnavailable {
tier: &'static str,
requested: u64,
available: u64,
role: MemoryRole,
detail: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
}Expand description
Shared error vocabulary for mechanism and governance operations.
Not Clone/PartialEq: a refusal that carries the cause underneath it
cannot be meaningfully duplicated or compared, and keeping the cause is
worth more than either. Match on the variant instead.
Variants§
TierExhausted
The tier does not have room, and no holder released enough.
Fields
role: MemoryRoleThe role that was refused.
InvalidRequest
The request itself is not representable.
Fields
AllocationFailed
The request was well formed and within budget, but the allocator behind the tier refused it for a reason of its own.
Distinct from MemoryError::TierExhausted, which means we declined,
and from MemoryError::InvalidRequest, which means the caller asked
for something impossible. This one carries the backing allocator’s own
account of the failure, which is usually the only thing that identifies
it: a driver that is out of memory and a driver that has no context both
fail an allocation, and calling them both “out of memory” sends the next
person to read the log in the wrong direction.
Fields
A well-formed capacity transfer or backing claim could not make enough governed bytes available.
Trait Implementations§
Source§impl Debug for MemoryError
impl Debug for MemoryError
Source§impl Display for MemoryError
impl Display for MemoryError
Source§impl Error for MemoryError
impl Error for MemoryError
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()