pub enum ResourceError {
StaleHandle {
handle: ResourceId,
},
NotOwner {
handle: ResourceId,
expected_owner: String,
actual_caller: String,
},
NotAllocated {
handle: ResourceId,
},
BorrowsOutstanding {
handle: ResourceId,
borrow_count: u32,
},
MutableLeaseActive {
handle: ResourceId,
},
ReadOnlyLeasesActive {
handle: ResourceId,
},
BudgetExceeded {
component: ComponentId,
current_bytes: u64,
requested_bytes: u64,
budget_bytes: u64,
},
AllocationFailed {
requested_capacity: u32,
reason: String,
},
CapacityExceeded {
handle: ResourceId,
capacity: u32,
attempted_size: u64,
},
OutOfBounds {
handle: ResourceId,
offset: u64,
buffer_size: u64,
},
}Expand description
Resource management errors.
Error code range: E0300–E0399.
Variants§
StaleHandle
The resource handle refers to a slot that has been freed and reused.
Fields
handle: ResourceIdThe stale handle.
NotOwner
The caller is not the owner of the resource.
Fields
handle: ResourceIdThe resource handle.
NotAllocated
The resource is not currently allocated (still in pool).
Fields
handle: ResourceIdThe resource handle.
BorrowsOutstanding
Outstanding borrows prevent the requested operation.
MutableLeaseActive
A mutable lease is active, preventing the requested operation.
Fields
handle: ResourceIdThe resource handle.
ReadOnlyLeasesActive
Read-only leases are active, preventing the requested operation.
Fields
handle: ResourceIdThe resource handle.
BudgetExceeded
The component’s memory budget would be exceeded.
Fields
component: ComponentIdThe component exceeding its budget.
AllocationFailed
Buffer pool is exhausted and system allocator fallback failed.
CapacityExceeded
The write would exceed the buffer’s capacity.
Fields
handle: ResourceIdThe resource handle.
OutOfBounds
The offset is out of bounds.
Trait Implementations§
Source§impl Clone for ResourceError
impl Clone for ResourceError
Source§fn clone(&self) -> ResourceError
fn clone(&self) -> ResourceError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§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()