Skip to main content

BitBoardKernel

Trait BitBoardKernel 

Source
pub trait BitBoardKernel:
    Send
    + Sync
    + 'static {
    // Required methods
    fn rook_attacks(square: u8, occupancy: u64) -> u64;
    fn bishop_attacks(square: u8, occupancy: u64) -> u64;

    // Provided method
    fn queen_attacks(square: u8, occupancy: u64) -> u64 { ... }
}
Expand description

Trait defining the sliding attack generation interface.

Implemented by backend markers in the intrinsics crate.

These methods are safe. Unlike SimdKernel, whose operations are #[target_feature]-gated and therefore carry an ISA precondition, an attack generator either computes with plain integer arithmetic or selects its ISA-specific path by runtime detection behind its own safe surface. Table lookups are bounds-checked, so an out-of-range square panics rather than reading out of bounds.

Required Methods§

Source

fn rook_attacks(square: u8, occupancy: u64) -> u64

Generate Rook attacks for a square given occupancy.

§Panics

If square is not a board index below 64.

Source

fn bishop_attacks(square: u8, occupancy: u64) -> u64

Generate Bishop attacks for a square given occupancy.

§Panics

If square is not a board index below 64.

Provided Methods§

Source

fn queen_attacks(square: u8, occupancy: u64) -> u64

Generate Queen attacks for a square given occupancy.

§Panics

If square is not a board index below 64.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§