UciInfo

Struct UciInfo 

Source
pub struct UciInfo {
Show 17 fields pub depth: Option<String>, pub seldepth: Option<String>, pub time: Option<String>, pub nodes: Option<String>, pub pv: Vec<String>, pub multipv: Option<String>, pub score: Option<UciScore>, pub currmove: Option<String>, pub currmovenumber: Option<String>, pub hashfull: Option<String>, pub nps: Option<String>, pub tbhits: Option<String>, pub sbhits: Option<String>, pub cpuload: Option<String>, pub string: Option<String>, pub refutation: Vec<String>, pub currline: Vec<String>,
}
Expand description

Represents all information that can be sent with the info command.

Fields§

§depth: Option<String>
depth <x>

Search depth (in plies).

§seldepth: Option<String>
seldepth <x>

Selective search depth (in plies),

If the engine sends seldepth there must also be a depth present in the same string.

§time: Option<String>
time <x>

The time searched (in ms). This should be sent together with the pv.

§nodes: Option<String>
nodes <x>

<x> nodes searched. The engine should send this info regularly.

§pv: Vec<String>
pv <move_1> [<move_2> ... <move_i>]

The best line found.

§multipv: Option<String>
multipv <num>

This for the multi pv mode.

For the best move/pv add multipv 1 in the string when you send the pv.

In k-best mode always send all k variants in k strings together.

§score: Option<UciScore>
score [cp <x> | mate <y> | lowerbound | upperbound]
  • cp <x> - The score from the engine’s point of view in centipawns.
  • mate <y> - Mate in y moves, not plies.

If the engine is getting mated, use negative values for y.

  • lowerbound - The score is just a lower bound.
  • upperbound - The score is just an upper bound.
§currmove: Option<String>
currmove <move>

Currently searching this move

§currmovenumber: Option<String>
Currmovenumber <x>

Currently searching move number x, for the first move x should be 1 not 0.

§hashfull: Option<String>
hashfull <x>

The hash is x permill full.

The engine should send this info regularly.

§nps: Option<String>
nps <x>

x nodes per second searched.

The engine should send this info regularly.

§tbhits: Option<String>
tbhits <x>

x positions where found in the endgame table bases.

§sbhits: Option<String>
sbhits <x>

x positions where found in the shredder endgame databases.

§cpuload: Option<String>
cpuload x

The cpu usage of the engine is x permill.

§string: Option<String>
string <str>

Any string str which will be displayed be the engine.

If there is a string command the rest of the line will be interpreted as str.

§refutation: Vec<String>
refutation <move_1> <move_2> ... <move_i>

Move <move_1> is refuted by the line <move_2> ... <move_1>. i can be any number >= 1.

Example: after move d1h5 is searched, the engine can send info refutation d1h5 g6h5 if g6h5 is the best answer after d1h5 or if g6h5 refutes the move d1h5.

If there is no refutation for d1h5 found, the engine should just send info refutation d1h5.

The engine should only send this if the option UCI_ShowRefutations is set to true.

§currline: Vec<String>
currline <cpnunr> <move_1> [<move_2> ... <move_i>]

This is the current line the engine is calculating. cpunr is the number of the cpu if the engine is running on more than one cpu. cpunr = 1,2,3....

if the engine is just using one cpu, cpunr can be omitted.

If cpunr is greater than 1, always send all k lines in k strings together.

The engine should only send this if the option UCI_ShowCurrLine is set to true.

Implementations§

Source§

impl UciInfo

Source

pub fn new() -> Self

Creates a new, empty, UciInfo struct.

Source

pub fn depth(self, depth: impl Display) -> Self

Consumes self and adds the provided depth value.

Source

pub fn seldepth(self, seldepth: impl Display) -> Self

Consumes self and adds the provided seldepth value.

Source

pub fn time(self, time: impl Display) -> Self

Consumes self and adds the provided time value.

Source

pub fn nodes(self, nodes: impl Display) -> Self

Consumes self and adds the provided nodes value.

Source

pub fn multipv(self, multipv: impl Display) -> Self

Consumes self and adds the provided multipv value.

Source

pub fn score(self, score: impl Into<UciScore>) -> Self

Consumes self and adds the provided score value.

Source

pub fn currmove(self, currmove: impl Display) -> Self

Consumes self and adds the provided currmove value.

Source

pub fn currmovenumber(self, currmovenumber: impl Display) -> Self

Consumes self and adds the provided currmovenumber value.

Source

pub fn hashfull(self, hashfull: impl Display) -> Self

Consumes self and adds the provided hashfull value.

Source

pub fn nps(self, nps: impl Display) -> Self

Consumes self and adds the provided nps value.

Source

pub fn tbhits(self, tbhits: impl Display) -> Self

Consumes self and adds the provided tbhits value.

Source

pub fn sbhits(self, sbhits: impl Display) -> Self

Consumes self and adds the provided sbhits value.

Source

pub fn cpuload(self, cpuload: impl Display) -> Self

Consumes self and adds the provided cpuload value.

Source

pub fn string(self, string: impl Display) -> Self

Consumes self and adds the provided string value.

Source

pub fn pv<T: Display>(self, pv: impl IntoIterator<Item = T>) -> Self

Consumes self and adds the provided pv value.

Source

pub fn refutation<T: Display>( self, refutation: impl IntoIterator<Item = T>, ) -> Self

Consumes self and adds the provided refutation value.

Source

pub fn currline<T: Display>(self, currline: impl IntoIterator<Item = T>) -> Self

Consumes self and adds the provided currline value.

Trait Implementations§

Source§

impl Clone for UciInfo

Source§

fn clone(&self) -> UciInfo

Returns a duplicate 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 Debug for UciInfo

Source§

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

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

impl Default for UciInfo

Source§

fn default() -> UciInfo

Returns the “default value” for a type. Read more
Source§

impl Display for UciInfo

Source§

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

An info command will only display data that it has.

Any None fields are not displayed.

Source§

impl Hash for UciInfo

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 UciInfo

Source§

fn eq(&self, other: &UciInfo) -> 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 Eq for UciInfo

Source§

impl StructuralPartialEq for UciInfo

Auto Trait Implementations§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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