Struct shakmaty::PositionError
source · 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.
pub fn ignore_impossible_material(self) -> Result<P, Self>
👎Deprecated: Use
PositionErrorKinds::ignore_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 copy 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>
Available on crate feature std
only.
impl<P> Error for PositionError<P>
Available on crate feature
std
only.1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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