#[non_exhaustive]pub enum Error {
Stale(ResourceId),
Busy(ResourceId),
Draining(ResourceId),
NotOwner(ResourceId),
NotReserved(Lease),
CreationBudget {
key: Key,
max_live: u32,
},
KeyFull {
capacity: usize,
},
Full {
capacity: usize,
},
Malformed(String),
Io(Error),
}Expand description
Additions are expected: a cause discovered later lands here rather than in a new major version, so a caller matches what it handles and leaves the rest to a catch-all.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Stale(ResourceId)
The id names a slot nothing occupies, or a generation that ended.
Busy(ResourceId)
Every unit of the resource’s capacity is leased right now.
Draining(ResourceId)
The owner is draining it; no new leases.
NotOwner(ResourceId)
Only the owner may do this to a resource.
NotReserved(Lease)
The lease is not among the resource’s unaccepted reservations: it was accepted already, aged out by the owner’s reconcile, or taken on a generation that ended.
CreationBudget
The key’s creation budget is spent: live plus in-progress reached the limit the caller gave.
KeyFull
Every key slot is taken.
Full
Every resource slot in this process’s lane is taken.
Malformed(String)
Io(Error)
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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 !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
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