pub struct UnalignedPositionsError {
pub position1: Position,
pub position2: Position,
}Expand description
Error indicating that two Positions are not aligned
Fields§
§position1: PositionThe first Position that is not aligned
position2: PositionThe second Position that is not aligned
Implementations§
Source§impl UnalignedPositionsError
impl UnalignedPositionsError
Sourcepub fn new(position1: Position, position2: Position) -> Self
pub fn new(position1: Position, position2: Position) -> Self
Creates a new UnalignedPositionsError with the given positions
§Arguments
position1- The first Position that is not alignedposition2- The second Position that is not aligned
§Example
use chess_lab::core::Position;
let position1 = Position::from_string("a1").unwrap();
let position2 = Position::from_string("b3").unwrap();
let error = UnalignedPositionsError::new(position1, position2);Trait Implementations§
Source§impl Debug for UnalignedPositionsError
impl Debug for UnalignedPositionsError
Source§impl Display for UnalignedPositionsError
impl Display for UnalignedPositionsError
Source§impl Error for UnalignedPositionsError
impl Error for UnalignedPositionsError
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 From<UnalignedPositionsError> for PositionBetweenError
impl From<UnalignedPositionsError> for PositionBetweenError
Source§fn from(source: UnalignedPositionsError) -> Self
fn from(source: UnalignedPositionsError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for UnalignedPositionsError
impl PartialEq for UnalignedPositionsError
impl StructuralPartialEq for UnalignedPositionsError
Auto Trait Implementations§
impl Freeze for UnalignedPositionsError
impl RefUnwindSafe for UnalignedPositionsError
impl Send for UnalignedPositionsError
impl Sync for UnalignedPositionsError
impl Unpin for UnalignedPositionsError
impl UnsafeUnpin for UnalignedPositionsError
impl UnwindSafe for UnalignedPositionsError
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