#[non_exhaustive]pub enum CollectionError {
TooFew {
min: usize,
actual: usize,
},
TooMany {
max: usize,
actual: usize,
},
InvalidBounds {
min: usize,
max: usize,
},
ZeroCapacity,
Duplicate,
}Expand description
Error returned by bounded collection operations.
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.
TooFew
The collection has fewer elements than the required minimum.
Fields
TooMany
The collection has more elements than the allowed maximum.
Fields
InvalidBounds
The const generic bounds are invalid (MIN > MAX).
ZeroCapacity
A capacity of zero was requested where a positive capacity is required.
Duplicate
A duplicate key or element was supplied where uniqueness is required.
Trait Implementations§
Source§impl Clone for CollectionError
impl Clone for CollectionError
Source§fn clone(&self) -> CollectionError
fn clone(&self) -> CollectionError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 CollectionError
impl Debug for CollectionError
Source§impl Display for CollectionError
impl Display for CollectionError
impl Eq for CollectionError
Source§impl Error for CollectionError
Available on crate feature std only.
impl Error for CollectionError
Available on crate feature
std only.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 PartialEq for CollectionError
impl PartialEq for CollectionError
Source§fn eq(&self, other: &CollectionError) -> bool
fn eq(&self, other: &CollectionError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CollectionError
Auto Trait Implementations§
impl Freeze for CollectionError
impl RefUnwindSafe for CollectionError
impl Send for CollectionError
impl Sync for CollectionError
impl Unpin for CollectionError
impl UnsafeUnpin for CollectionError
impl UnwindSafe for CollectionError
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