[−][src]Enum gridly::range::RangeError
Error indicating that a Row or Column was out of bounds.
Note that the bounds expressed in this error are half inclusive; that is,
the lower bound in TooLow is an inclusive lower bound, but the upper bound
in TooHigh is an exclusive upper bound. This is consistent with the
conventional range representation of low..high
.
Example:
use gridly::range::{ComponentRange, RangeError}; use gridly::location::Row; let range = ComponentRange::bounded(Row(0), Row(10)); assert_eq!(range.check(-5), Err(RangeError::TooLow(Row(0)))); assert_eq!(range.check(15), Err(RangeError::TooHigh(Row(10)))); assert_eq!(range.check(10), Err(RangeError::TooHigh(Row(10))));
Variants
The given row or column was too low. The value in the error is the minimum row or column, inclusive.
The given row or column was too high. The given value in the error is the maximum row or column, exclusive (that is, a value equal to the error value is considered too high).
Trait Implementations
impl<T: Eq + Component> Eq for RangeError<T>
[src]
impl<T: Clone + Component> Clone for RangeError<T>
[src]
fn clone(&self) -> RangeError<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: PartialEq + Component> PartialEq<RangeError<T>> for RangeError<T>
[src]
fn eq(&self, other: &RangeError<T>) -> bool
[src]
fn ne(&self, other: &RangeError<T>) -> bool
[src]
impl From<RangeError<Row>> for BoundsError
[src]
fn from(err: RowRangeError) -> Self
[src]
impl From<RangeError<Column>> for BoundsError
[src]
fn from(err: ColumnRangeError) -> Self
[src]
impl<T: Copy + Component> Copy for RangeError<T>
[src]
impl<T: Debug + Component> Debug for RangeError<T>
[src]
impl<T: Component> Display for RangeError<T>
[src]
Auto Trait Implementations
impl<T> Send for RangeError<T> where
T: Send,
T: Send,
impl<T> Unpin for RangeError<T> where
T: Unpin,
T: Unpin,
impl<T> Sync for RangeError<T> where
T: Sync,
T: Sync,
impl<T> UnwindSafe for RangeError<T> where
T: UnwindSafe,
T: UnwindSafe,
impl<T> RefUnwindSafe for RangeError<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,