Struct coca::CapacityError
source · [−]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
sourceimpl Clone for CapacityError
impl Clone for CapacityError
sourcefn clone(&self) -> CapacityError
fn clone(&self) -> CapacityError
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for CapacityError
impl Debug for CapacityError
sourceimpl Default for CapacityError
impl Default for CapacityError
sourcefn default() -> CapacityError
fn default() -> CapacityError
Returns the “default value” for a type. Read more
impl Copy for CapacityError
Auto Trait Implementations
impl RefUnwindSafe for CapacityError
impl Send for CapacityError
impl Sync for CapacityError
impl Unpin for CapacityError
impl UnwindSafe for CapacityError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more