Struct shakmaty::PositionError
source · [−]pub struct PositionError<P> { /* private fields */ }
Implementations
sourceimpl<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
sourceimpl<P: Clone> Clone for PositionError<P>
impl<P: Clone> Clone for PositionError<P>
sourcefn clone(&self) -> PositionError<P>
fn clone(&self) -> PositionError<P>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<P> Debug for PositionError<P>
impl<P> Debug for PositionError<P>
sourceimpl<P> Display for PositionError<P>
impl<P> Display for PositionError<P>
sourceimpl<P> Error for PositionError<P>
impl<P> Error for PositionError<P>
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>
🔬 This is a nightly-only experimental API. (
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
👎 Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more