Struct Move

Source
pub struct Move { /* private fields */ }

Implementations§

Source§

impl Move

Source

pub const fn new_unchecked( source: Square, dest: Square, promotion: Option<PieceType>, ) -> Self

Source

pub const fn new( source: Square, dest: Square, promotion: Option<PieceType>, ) -> Result<Self>

Source

pub const fn get_source(&self) -> Square

Source

pub const fn get_dest(&self) -> Square

Source

pub const fn get_promotion(&self) -> Option<PieceType>

Source

pub fn from_uci(uci: &str) -> Result<Self>

Source

pub fn from_san(position: &ChessPosition, san: &str) -> Result<Self>

Source

pub fn from_lan(position: &ChessPosition, lan: &str) -> Result<Self>

Source

pub fn algebraic_without_suffix( self, position: &ChessPosition, long: bool, ) -> Result<String>

Source

pub fn algebraic_and_new_position( self, position: &ChessPosition, long: bool, ) -> Result<(String, ChessPosition)>

Trait Implementations§

Source§

impl BoardMethodOverload<Move> for Board

Source§

fn push_unchecked(&mut self, move_: Move)

Source§

fn push(&mut self, move_: Move) -> Result<()>

Source§

fn gives_repetition(&self, move_: Move) -> bool

Source§

fn gives_threefold_repetition(&self, move_: Move) -> bool

Source§

fn gives_claimable_threefold_repetition(&self, move_: Move) -> bool

Source§

impl BoardPositionMethodOverload<Move> for ChessPosition

Source§

fn parse_san(&self, san: &str) -> Result<Move>

Source§

fn parse_lan(&self, lan: &str) -> Result<Move>

Source§

fn parse_uci(&self, uci: &str) -> Result<Move>

Source§

fn make_move_new(&self, move_: Move) -> Self

Source§

fn make_move(&mut self, valid_or_null_move: T)
where Self: Sized,

Source§

impl Clone for Move

Source§

fn clone(&self) -> Move

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Compress for Move

Source§

impl Debug for Move

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Move

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Move

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<&Move> for ValidOrNullMove

Source§

fn from(value: &Move) -> Self

Converts to this type from the input type.
Source§

impl From<Move> for ValidOrNullMove

Source§

fn from(value: Move) -> Self

Converts to this type from the input type.
Source§

impl<'source> FromPyObject<'source> for Move

Source§

fn extract_bound(ob: &Bound<'source, PyAny>) -> PyResult<Self>

Extracts Self from the bound smart pointer obj. Read more
Source§

impl FromStr for Move

Source§

type Err = TimecatError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for Move

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Move

Source§

fn eq(&self, other: &Move) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<P: PositionEvaluation> SearcherMethodOverload<Move> for Searcher<P>

Source§

fn push_unchecked(&mut self, move_: Move)

Source§

impl Serialize for Move

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Stringify for Move

Source§

impl StringifyMove for Move

Source§

fn uci(self) -> String

Source§

fn algebraic(self, position: &ChessPosition, long: bool) -> Result<String>

Source§

fn stringify_move(self, position: &ChessPosition) -> Result<String>

Source§

fn san(self, position: &ChessPosition) -> Result<String>
where Self: Sized,

Source§

fn lan(self, position: &ChessPosition) -> Result<String>
where Self: Sized,

Source§

impl Copy for Move

Source§

impl Eq for Move

Source§

impl StructuralPartialEq for Move

Auto Trait Implementations§

§

impl Freeze for Move

§

impl RefUnwindSafe for Move

§

impl Send for Move

§

impl Sync for Move

§

impl Unpin for Move

§

impl UnwindSafe for Move

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> CustomColorize for T
where T: ToString,

Source§

fn colorize( &self, style_functions: &[fn(_: ColoredString) -> ColoredString], ) -> String

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<'py, T> FromPyObjectBound<'_, 'py> for T
where T: FromPyObject<'py>,

Source§

fn from_py_object_bound(ob: Borrowed<'_, 'py, PyAny>) -> Result<T, PyErr>

Extracts Self from the bound smart pointer obj. Read more
Source§

impl<T> FromQuery for T

Source§

type Target = T

Target type after parsing.
Source§

type Error = HistoryError

Error that can occur while parsing.
Source§

fn from_query( query: &str, ) -> Result<<T as FromQuery>::Target, <T as FromQuery>::Error>

Decode this query string into the target type.
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToQuery for T
where T: Serialize,

Source§

type Error = HistoryError

Error that can be returned from the conversion.
Source§

fn to_query(&self) -> Result<Cow<'_, str>, <T as ToQuery>::Error>

Method to encode the query into a string.
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> Ungil for T
where T: Send,