Struct timecat::utils::moves::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_san(sub_board: &SubBoard, san: &str) -> Result<Self>

source

pub fn from_lan(sub_board: &SubBoard, lan: &str) -> Result<Self>

source

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

source

pub fn algebraic_and_new_sub_board( self, sub_board: &SubBoard, long: bool, ) -> Result<(String, SubBoard)>

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 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 FromStr for Move

§

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, sub_board: &SubBoard, long: bool) -> Result<String>

source§

fn stringify_move(self, sub_board: &SubBoard) -> Result<String>

source§

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

source§

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

source§

impl SubBoardMethodOverload<Move> for SubBoard

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 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§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

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

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

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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<T> FromQuery for T

§

type Target = T

Target type after parsing.
§

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,

§

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,

§

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§

default 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>,

§

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>,

§

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>,