pub struct GameRow {Show 32 fields
pub id: String,
pub white: Account,
pub black: Account,
pub variant: String,
pub initial_fen: Option<String>,
pub rated: bool,
pub source: String,
pub speed: Speed,
pub rules: Vec<String>,
pub clock_initial_ms: Option<i64>,
pub clock_increment_ms: Option<i64>,
pub status: Status,
pub winner: Option<Side>,
pub moves: String,
pub ply: i32,
pub fen: String,
pub white_ms: Option<i64>,
pub black_ms: Option<i64>,
pub move_ms: Vec<i64>,
pub clock_ms: Vec<i64>,
pub draw_offer: Option<Side>,
pub takeback_offer: Option<Side>,
pub white_rating: i32,
pub black_rating: i32,
pub white_provisional: bool,
pub black_provisional: bool,
pub white_rating_diff: Option<i32>,
pub black_rating_diff: Option<i32>,
pub created_ms: i64,
pub last_move_ms: Option<i64>,
pub finished_ms: Option<i64>,
pub elapsed_ms: i64,
}Fields§
§id: String§white: Account§black: Account§variant: String§initial_fen: Option<String>§rated: bool§source: String§speed: Speed§rules: Vec<String>§clock_initial_ms: Option<i64>§clock_increment_ms: Option<i64>§status: Status§winner: Option<Side>§moves: String§ply: i32§fen: String§white_ms: Option<i64>§black_ms: Option<i64>§move_ms: Vec<i64>§clock_ms: Vec<i64>§draw_offer: Option<Side>§takeback_offer: Option<Side>§white_rating: i32§black_rating: i32§white_provisional: bool§black_provisional: bool§white_rating_diff: Option<i32>§black_rating_diff: Option<i32>§created_ms: i64§last_move_ms: Option<i64>§finished_ms: Option<i64>§elapsed_ms: i64Milliseconds since the side to move’s turn began (database clock).
Implementations§
Source§impl GameRow
impl GameRow
pub fn from_row(r: &Row) -> GameRow
pub fn side_of(&self, player: i64) -> Option<Side>
pub fn player(&self, side: Side) -> &Account
pub fn rating(&self, side: Side) -> (i32, bool, Option<i32>)
pub fn has_clock(&self) -> bool
Sourcepub fn clock_running(&self) -> bool
pub fn clock_running(&self) -> bool
Clocks run once each side has made a first move.
pub fn last_move(&self) -> &str
pub fn variant(&self) -> Variant
pub fn perf_key(&self) -> &'static str
pub fn full_id(&self, player: i64) -> String
pub fn has_rule(&self, rule: &str) -> bool
pub fn event_player(&self, side: Side) -> GameEventPlayer
pub fn state(&self, first_move_ms: i64) -> GameState
pub fn full(&self, first_move_ms: i64) -> GameFull
Sourcepub fn event_info(&self, player: i64) -> Option<GameEventInfo>
pub fn event_info(&self, player: i64) -> Option<GameEventInfo>
gameStart / gameFinish / nowPlaying entry, from player’s side.
pub fn event(&self, player: i64, kind: &str) -> Option<Value>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GameRow
impl RefUnwindSafe for GameRow
impl Send for GameRow
impl Sync for GameRow
impl Unpin for GameRow
impl UnsafeUnpin for GameRow
impl UnwindSafe for GameRow
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more