[][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: Clone + Component> Clone for RangeError<T>[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]

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

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

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

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

impl<T: Component> StructuralEq for RangeError<T>[src]

impl<T: Component> StructuralPartialEq for RangeError<T>[src]

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

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

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

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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.