Struct shakmaty::PositionError
source · pub struct PositionError<P> { /* private fields */ }
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_impossible_material(self) -> Result<P, Self>
pub fn ignore_impossible_material(self) -> Result<P, Self>
Get the position despite PositionErrorKinds::IMPOSSIBLE_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
.
Note that other programs may not work in such a situation.
pub fn kinds(&self) -> PositionErrorKinds
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()