pub struct UciScore {
pub score: i32,
pub score_type: UciScoreType,
pub bound: Option<UciBound>,
}
Expand description
A “score” in the game of chess.
Usually in the form of centipawns or “mate in n
moves”
and may optionally be an upper/lower bound.
Fields§
§score: i32
The score value, which is either a centipawn value or moves-to-mate,
depending on the value of score_type
.
score_type: UciScoreType
Either cp
or mate
.
bound: Option<UciBound>
Either lowerbound
or upperbound
.
Implementations§
Source§impl UciScore
impl UciScore
Sourcepub const fn new(
score: i32,
score_type: UciScoreType,
bound: Option<UciBound>,
) -> Self
pub const fn new( score: i32, score_type: UciScoreType, bound: Option<UciBound>, ) -> Self
Construct a new UciScore
with the provided score
, score_type
, and
bound
.
Sourcepub const fn new_unbounded(score: i32, score_type: UciScoreType) -> Self
pub const fn new_unbounded(score: i32, score_type: UciScoreType) -> Self
Construct a new UciScore
with the provided score
and score_type
Sourcepub const fn cp(score: i32) -> Self
pub const fn cp(score: i32) -> Self
Construct a new UciScore
with score_type
UciScoreType::Centipawns
.
Sourcepub const fn mate(moves_to_mate: i32) -> Self
pub const fn mate(moves_to_mate: i32) -> Self
Construct a new UciScore
with score_type
UciScoreType::Mate
.
Sourcepub const fn with_bound(self, bound: UciBound) -> Self
pub const fn with_bound(self, bound: UciBound) -> Self
Consumes self
and appends the provided UciBound
onto self
.
Trait Implementations§
Source§impl Ord for UciScore
impl Ord for UciScore
Source§impl PartialOrd for UciScore
impl PartialOrd for UciScore
impl Copy for UciScore
impl Eq for UciScore
impl StructuralPartialEq for UciScore
Auto Trait Implementations§
impl Freeze for UciScore
impl RefUnwindSafe for UciScore
impl Send for UciScore
impl Sync for UciScore
impl Unpin for UciScore
impl UnwindSafe for UciScore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more