[−][src]Enum gridly::grid::BoundsError
An out-of-bounds error for a Location on a grid
This error is returned by methods that perform bounds checking to indicate a failed bounds check. It includes the specific boundary or boundaries that were violated.
Variants
Row(RowRangeError)
The location's Row
was out of bounds.
Column(ColumnRangeError)
The location's Column
was out of bounds.
Both the Row
and the Column
were out of bounds.
Fields of Both
row: RowRangeError
column: ColumnRangeError
Methods
impl BoundsError
[src]
pub fn row(&self) -> Option<&RowRangeError>
[src]
The row component of the boundary error, if applicable.
use gridly::prelude::*; let row_error = RowRangeError::TooLow(Row(0)); let col_error = ColumnRangeError::TooLow(Column(0)); assert_eq!(BoundsError::Row(row_error).row(), Some(&row_error)); assert_eq!(BoundsError::Column(col_error).row(), None); assert_eq!( BoundsError::Both{row: row_error, column: col_error}.row(), Some(&row_error) );
pub fn column(&self) -> Option<&ColumnRangeError>
[src]
The column component of the boundary error, if applicable.
use gridly::prelude::*; let row_error = RowRangeError::TooLow(Row(0)); let col_error = ColumnRangeError::TooLow(Column(0)); assert_eq!(BoundsError::Row(row_error).column(), None); assert_eq!(BoundsError::Column(col_error).column(), Some(&col_error)); assert_eq!( BoundsError::Both{row: row_error, column: col_error}.column(), Some(&col_error) );
Trait Implementations
impl Eq for BoundsError
[src]
impl Clone for BoundsError
[src]
fn clone(&self) -> BoundsError
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl PartialEq<BoundsError> for BoundsError
[src]
fn eq(&self, other: &BoundsError) -> bool
[src]
fn ne(&self, other: &BoundsError) -> 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 Copy for BoundsError
[src]
impl Debug for BoundsError
[src]
impl Display for BoundsError
[src]
Auto Trait Implementations
impl Send for BoundsError
impl Unpin for BoundsError
impl Sync for BoundsError
impl UnwindSafe for BoundsError
impl RefUnwindSafe for BoundsError
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,