pub struct GameReplayCache {
pub game_id: String,
pub started_at: Instant,
pub player_order: Vec<String>,
pub player_decks: Vec<PlayerDeckInfo>,
pub starting_life: i32,
pub last_state: Option<Value>,
pub last_state_by_slot: HashMap<String, Value>,
pub pending_prompts: HashMap<String, Value>,
pub queued_inputs: HashMap<String, Vec<QueuedEngineInput>>,
pub outcome: ObservedOutcome,
}Fields§
§game_id: String§started_at: Instant§player_order: Vec<String>§player_decks: Vec<PlayerDeckInfo>§starting_life: i32§last_state: Option<Value>§last_state_by_slot: HashMap<String, Value>§pending_prompts: HashMap<String, Value>§queued_inputs: HashMap<String, Vec<QueuedEngineInput>>§outcome: ObservedOutcomeImplementations§
Source§impl GameReplayCache
impl GameReplayCache
pub fn new( game_id: String, player_order: Vec<String>, player_decks: Vec<PlayerDeckInfo>, starting_life: i32, ) -> Self
pub fn observe(&mut self, envelope: &Value)
pub fn slot_for(&self, username: &str) -> Option<String>
pub fn username_for_slot(&self, slot: &str) -> Option<String>
pub fn queue_input( &mut self, host_username: &str, from_player: &str, state: Value, )
pub fn queued_inputs_for(&self, username: &str) -> Vec<QueuedEngineInput>
pub fn acknowledge_inputs(&mut self, host_username: &str)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GameReplayCache
impl RefUnwindSafe for GameReplayCache
impl Send for GameReplayCache
impl Sync for GameReplayCache
impl Unpin for GameReplayCache
impl UnsafeUnpin for GameReplayCache
impl UnwindSafe for GameReplayCache
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