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§
Source§impl Debug for InvalidBoard
impl Debug for InvalidBoard
Source§impl Display for InvalidBoard
impl Display for InvalidBoard
Source§impl Error for InvalidBoard
impl Error for InvalidBoard
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl PartialEq for InvalidBoard
impl PartialEq for InvalidBoard
impl Eq for InvalidBoard
impl StructuralPartialEq for InvalidBoard
Auto Trait Implementations§
impl Freeze for InvalidBoard
impl RefUnwindSafe for InvalidBoard
impl Send for InvalidBoard
impl Sync for InvalidBoard
impl Unpin for InvalidBoard
impl UnwindSafe for InvalidBoard
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more