[][src]Enum gridly::range::RangeError

pub enum RangeError<T: Component> {
    TooLow(T),
    TooHigh(T),
}

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

TooLow(T)

The given row or column was too low. The value in the error is the minimum row or column, inclusive.

TooHigh(T)

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]

impl<T: PartialEq + Component> PartialEq<RangeError<T>> for RangeError<T>[src]

impl From<RangeError<Row>> for BoundsError[src]

impl From<RangeError<Column>> for BoundsError[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

impl<T> Unpin for RangeError<T> where
    T: Unpin

impl<T> Sync for RangeError<T> where
    T: Sync

impl<T> UnwindSafe for RangeError<T> where
    T: UnwindSafe

impl<T> RefUnwindSafe for RangeError<T> where
    T: RefUnwindSafe

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]