pub enum Error<N: Display> {
OutOfRange(N),
NotDense,
DuplicateElement(N),
NotSorted(N),
}Expand description
Error enumeration associated with the Ranged trait.
§Examples
use multi_ranged::{MultiRanged, SimpleRange, errors::Error};
let mut range = SimpleRange::from(5);
let err = range.insert(5).unwrap_err();
assert!(matches!(err, Error::DuplicateElement(5)));Variants§
OutOfRange(N)
The provided element cannot be added to the range.
NotDense
The provided range is not dense.
DuplicateElement(N)
The provided element already exists in the range.
NotSorted(N)
The provided element is not sorted correctly.
Trait Implementations§
Source§impl<N: Display> Error for Error<N>
impl<N: Display> Error for Error<N>
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<N: Ord + Display> Ord for Error<N>
impl<N: Ord + Display> Ord for Error<N>
Source§impl<N: PartialOrd + Display> PartialOrd for Error<N>
impl<N: PartialOrd + Display> PartialOrd for Error<N>
impl<N: Copy + Display> Copy for Error<N>
impl<N: Eq + Display> Eq for Error<N>
impl<N: Display> StructuralPartialEq for Error<N>
Auto Trait Implementations§
impl<N> Freeze for Error<N>where
N: Freeze,
impl<N> RefUnwindSafe for Error<N>where
N: RefUnwindSafe,
impl<N> Send for Error<N>where
N: Send,
impl<N> Sync for Error<N>where
N: Sync,
impl<N> Unpin for Error<N>where
N: Unpin,
impl<N> UnwindSafe for Error<N>where
N: UnwindSafe,
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