Enum hexgame::InvalidBoard
source · [−]pub enum InvalidBoard {
SizeOutOfBounds(usize, CoordValue, CoordValue),
NotSquare(CoordValue, CoordValue),
NoCurrentPlayer,
}
Expand description
This error may be returned by methods that load a board from serialized data.
Variants
SizeOutOfBounds(usize, CoordValue, CoordValue)
The size of the serialized board is not supported. Board sizes must be bounded by MIN_BOARD_SIZE
and MAX_BOARD_SIZE
.
The values contained in this error are: the size of the serialized data, the minimal supported size, and the maximal supported size.
NotSquare(CoordValue, CoordValue)
The serialized board is not square, i.e. at least one row has more/less entries than there are rows. The values contained in this error are: the detected board size (number of rows) and the index of the row where the problem occurred.
NoCurrentPlayer
When loading a game, no current player was specified, although the game has not yet finished.
Trait Implementations
sourceimpl Debug for InvalidBoard
impl Debug for InvalidBoard
sourceimpl Display for InvalidBoard
impl Display for InvalidBoard
sourceimpl Error for InvalidBoard
impl Error for InvalidBoard
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourceimpl PartialEq<InvalidBoard> for InvalidBoard
impl PartialEq<InvalidBoard> for InvalidBoard
sourcefn eq(&self, other: &InvalidBoard) -> bool
fn eq(&self, other: &InvalidBoard) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &InvalidBoard) -> bool
fn ne(&self, other: &InvalidBoard) -> bool
This method tests for !=
.
impl Eq for InvalidBoard
impl StructuralEq for InvalidBoard
impl StructuralPartialEq for InvalidBoard
Auto Trait Implementations
impl RefUnwindSafe for InvalidBoard
impl Send for InvalidBoard
impl Sync for InvalidBoard
impl Unpin for InvalidBoard
impl UnwindSafe for InvalidBoard
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more