pub struct CapacityError;
Expand description
The error type for many operations on data structures with constant capacity.
When working with data structures of limited capacity, insertions may fail
due to insufficient remaining space. In coca
, insertion methods generally
have a name starting with try
, and return a Result
.
For convenience, panicking wrappers without the try
prefix are also provided.
In many cases, such as e.g. Vec::try_push
,
the value to be inserted is returned back to the caller when the operation fails;
in some cases, this is unnecessary (e.g. when ownership is not transferred, as with
Vec::try_extend_from_slice
)
or would result in unwieldy type signatures. Such methods use this unit error type
instead.
Trait Implementations§
Source§impl Clone for CapacityError
impl Clone for CapacityError
Source§fn clone(&self) -> CapacityError
fn clone(&self) -> CapacityError
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 CapacityError
impl Debug for CapacityError
Source§impl Default for CapacityError
impl Default for CapacityError
Source§fn default() -> CapacityError
fn default() -> CapacityError
Returns the “default value” for a type. Read more
impl Copy for CapacityError
Auto Trait Implementations§
impl Freeze for CapacityError
impl RefUnwindSafe for CapacityError
impl Send for CapacityError
impl Sync for CapacityError
impl Unpin for CapacityError
impl UnwindSafe for CapacityError
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