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
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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)>
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()
Source§impl From<ResourceError> for TorvynError
impl From<ResourceError> for TorvynError
Source§fn from(e: ResourceError) -> Self
fn from(e: ResourceError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ResourceError
impl PartialEq for ResourceError
impl Eq for ResourceError
impl StructuralPartialEq for ResourceError
Auto Trait Implementations§
impl Freeze for ResourceError
impl RefUnwindSafe for ResourceError
impl Send for ResourceError
impl Sync for ResourceError
impl Unpin 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