race-core 0.2.6

RACE Protocol api types
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use race_api::error::Result;
use crate::types::{AttachGameParams, ExitGameParams, SubmitEventParams};
use async_trait::async_trait;

#[async_trait]
pub trait ConnectionT: Sync + Send{
    /// Attach to game. While processing this request, transactor will load
    /// the game into memory if it hasn't already been loaded.
    async fn attach_game(&self, game_addr: &str, params: AttachGameParams) -> Result<()>;

    /// Submit event to transactor.
    async fn submit_event(&self, game_addr: &str, params: SubmitEventParams) -> Result<()>;

    /// Exit game.  The request will fail if it's not allowed to quit at the moment.
    async fn exit_game(&self, game_addr: &str, params: ExitGameParams) -> Result<()>;
}