Struct shakmaty_syzygy::Tablebase [−][src]
A collection of tables.
Implementations
impl<S: Position + Clone + Syzygy> Tablebase<S>
[src]
pub fn new() -> Tablebase<S>
[src]
Create an empty collection of tables.
pub fn add_directory<P: AsRef<Path>>(&mut self, path: P) -> Result<usize>
[src]
Add all relevant tables from a directory.
Tables are selected by filename, e.g. KQvKP.rtbz
. The files are not
actually opened. This happens lazily when probing.
Returns the number of added table files.
Errors
Returns an error result when:
- The
path
does not exist. path
is not a directory.- The process lacks permissions to list the directory.
pub fn add_file<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
[src]
Add a table file.
The file is not actually opened. This happens lazily when probing.
Errors
Returns an error when no file exists at the given path or the
filename does not indicate that it is a valid table file
(e.g. KQvKP.rtbz
).
pub fn probe_wdl(&self, pos: &S) -> Result<Wdl, SyzygyError>
[src]
Probe tables for the Wdl
value of a position.
This indicates if the position is winning, lost or drawn with or without the 50-move rule.
Errors
See SyzygyError
for possible error
conditions.
pub fn probe_dtz(&self, pos: &S) -> Result<Dtz, SyzygyError>
[src]
Probe tables for the Dtz
value of a position.
Min-maxing the DTZ of the available moves guarantees achieving the optimal outcome under the 50-move rule.
Errors
See SyzygyError
for possible error
conditions.
pub fn best_move(&self, pos: &S) -> Result<Option<(Move, Dtz)>, SyzygyError>
[src]
Trait Implementations
impl<S: Debug + Position + Clone + Syzygy> Debug for Tablebase<S>
[src]
impl<S: Position + Clone + Syzygy> Default for Tablebase<S>
[src]
Auto Trait Implementations
impl<S> RefUnwindSafe for Tablebase<S> where
S: RefUnwindSafe + UnwindSafe,
S: RefUnwindSafe + UnwindSafe,
impl<S> Send for Tablebase<S> where
S: Send,
S: Send,
impl<S> Sync for Tablebase<S> where
S: Send + Sync,
S: Send + Sync,
impl<S> Unpin for Tablebase<S> where
S: Unpin,
S: Unpin,
impl<S> UnwindSafe for Tablebase<S> where
S: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,