pub trait JavaBridge {
// Required methods
fn initialize(&mut self, assets_dir: &str) -> Result<(), String>;
fn start_game_json(&mut self, request_json: &str) -> Result<String, String>;
fn submit_action(
&mut self,
session_id: &str,
action_json: &str,
) -> Result<String, String>;
fn get_prompt(
&mut self,
session_id: &str,
player_index: usize,
) -> Result<Option<String>, String>;
fn get_snapshot(
&mut self,
session_id: &str,
viewer: Option<usize>,
) -> Result<String, String>;
fn is_game_over(&mut self, session_id: &str) -> Result<bool, String>;
fn end_game(&mut self, session_id: &str) -> Result<(), String>;
fn abort_game(&mut self, session_id: &str) -> Result<(), String>;
}Required Methods§
fn initialize(&mut self, assets_dir: &str) -> Result<(), String>
fn start_game_json(&mut self, request_json: &str) -> Result<String, String>
fn submit_action( &mut self, session_id: &str, action_json: &str, ) -> Result<String, String>
fn get_prompt( &mut self, session_id: &str, player_index: usize, ) -> Result<Option<String>, String>
fn get_snapshot( &mut self, session_id: &str, viewer: Option<usize>, ) -> Result<String, String>
fn is_game_over(&mut self, session_id: &str) -> Result<bool, String>
fn end_game(&mut self, session_id: &str) -> Result<(), String>
fn abort_game(&mut self, session_id: &str) -> Result<(), String>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".