pub struct PositionError<P> { /* private fields */ }
Expand description
Error when trying to create a Position
from an illegal Setup
.
See PositionErrorKinds
for possible reasons.
Implementations§
Source§impl<P> PositionError<P>
impl<P> PositionError<P>
Sourcepub fn ignore_invalid_castling_rights(self) -> Result<P, Self>
pub fn ignore_invalid_castling_rights(self) -> Result<P, Self>
Discards invalid castling rights to recover from
PositionErrorKinds::INVALID_CASTLING_RIGHTS
.
Sourcepub fn ignore_invalid_ep_square(self) -> Result<P, Self>
pub fn ignore_invalid_ep_square(self) -> Result<P, Self>
Discards invalid en passant squares to recover from
PositionErrorKinds::INVALID_EP_SQUARE
.
Sourcepub fn ignore_too_much_material(self) -> Result<P, Self>
pub fn ignore_too_much_material(self) -> Result<P, Self>
Get the position despite PositionErrorKinds::TOO_MUCH_MATERIAL
.
Note that other programs may not work with too much material.
Sourcepub fn ignore_impossible_check(self) -> Result<P, Self>
pub fn ignore_impossible_check(self) -> Result<P, Self>
Get the position despite PositionErrorKinds::IMPOSSIBLE_CHECK
(not be be confused with PositionErrorKinds::OPPOSITE_CHECK
).
Note that other programs may not work in such a situation.
Sourcepub fn kinds(&self) -> PositionErrorKinds
pub fn kinds(&self) -> PositionErrorKinds
Returns the reasons for this error.
Trait Implementations§
Source§impl<P: Clone> Clone for PositionError<P>
impl<P: Clone> Clone for PositionError<P>
Source§fn clone(&self) -> PositionError<P>
fn clone(&self) -> PositionError<P>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<P> Debug for PositionError<P>
impl<P> Debug for PositionError<P>
Source§impl<P> Display for PositionError<P>
impl<P> Display for PositionError<P>
Source§impl<P> Error for PositionError<P>
impl<P> Error for PositionError<P>
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()
Auto Trait Implementations§
impl<P> Freeze for PositionError<P>where
P: Freeze,
impl<P> RefUnwindSafe for PositionError<P>where
P: RefUnwindSafe,
impl<P> Send for PositionError<P>where
P: Send,
impl<P> Sync for PositionError<P>where
P: Sync,
impl<P> Unpin for PositionError<P>where
P: Unpin,
impl<P> UnwindSafe for PositionError<P>where
P: UnwindSafe,
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