#[repr(transparent)]
pub struct Bitboard(_);
Expand description

A fast bitboard for representing chess positions. Bitboards compactly represent a subset of squares on a chess board in a way that allows fast bitwise operations to be performed.

They only indicate whether or not a particular square is included in a set.

Implementations§

An empty board with no squares occupied.

A board with all squares occupied.

A board with all the dark squares occupied.

A board with all the light squares occupied.

A board with all of the squares on the A file occupied.

A board with all of the squares on the B file occupied.

A board with all of the squares on the C file occupied.

A board with all of the squares on the D file occupied.

A board with all of the squares on the E file occupied.

A board with all of the squares on the F file occupied.

A board with all of the squares on the G file occupied.

A board with all of the squares on the H file occupied.

A board with all of the squares on the 1st rank occupied.

A board with all of the squares on the 2nd rank occupied.

A board with all of the squares on the 3rd rank occupied.

A board with all of the squares on the 4th rank occupied.

A board with all of the squares on the 5th rank occupied.

A board with all of the squares on the 6th rank occupied.

A board with all of the squares on the 7th rank occupied.

A board with all of the squares on the 8th rank occupied.

A board with all of the squares on the queenside occupied.

A board with all of the center files occupied.

A board with all of the squares on the kingside occupied.

A board with all of the squares in the center (D4, D5, E4, and E5) occupied.

A board with the edge files (A and H) occupied.

A board with the edge ranks (1 and 8) occupied;

A board with all of the edges occupied.

A board with all the corner squares occupied.

Returns true if the Bitboard does not contain any spaces.

Returns true if the Bitboard contains any spaces.

Returns true if the Bitboard contains only one space.

Returns true if the Bitboard contains more than one space.

Returns true if the Bitboard contains all squares.

Returns true if the Bitboard contains the given square.

Returns true if the Bitboard does not contain the given square.

Returns true if the Bitboard has any squares in common with the given Bitboard.

Returns true if the Bitboard has no overlapping squares in common with the given Bitboard

Returns one of the Squares that is included in this Bitboard. There is no guarantee as to which Square will be returned or that the same one will be returned from successive calls to this function.

Returns the number of Squares set in this Bitboard.

Trait Implementations§

The resulting type after applying the + operator.
Performs the + operation. Read more
The resulting type after applying the & operator.
Performs the & operation. Read more
The resulting type after applying the & operator.
Performs the & operation. Read more
The resulting type after applying the & operator.
Performs the & operation. Read more
The resulting type after applying the & operator.
Performs the & operation. Read more
Performs the &= operation. Read more
Performs the &= operation. Read more
Performs the &= operation. Read more
Performs the &= operation. Read more
The resulting type after applying the | operator.
Performs the | operation. Read more
The resulting type after applying the | operator.
Performs the | operation. Read more
The resulting type after applying the | operator.
Performs the | operation. Read more
The resulting type after applying the | operator.
Performs the | operation. Read more
Performs the |= operation. Read more
Performs the |= operation. Read more
Performs the |= operation. Read more
Performs the |= operation. Read more
The resulting type after applying the ^ operator.
Performs the ^ operation. Read more
The resulting type after applying the ^ operator.
Performs the ^ operation. Read more
The resulting type after applying the ^ operator.
Performs the ^ operation. Read more
The resulting type after applying the ^ operator.
Performs the ^ operation. Read more
Performs the ^= operation. Read more
Performs the ^= operation. Read more
Performs the ^= operation. Read more
Performs the ^= operation. Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
The resulting type after applying the ! operator.
Performs the unary ! operation. Read more
This method returns an Ordering between self and other. Read more
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
The resulting type after applying the << operator.
Performs the << operation. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Self must have the same layout as the specified Bits except for the possible invalid bit patterns being checked during is_valid_bit_pattern.
If this function returns true, then it must be valid to reinterpret bits as &Self.

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.