pub trait Scriptable {
// Required methods
fn spawn_script_core(
&mut self,
this: Arc<RwLock<dyn GameObject>>,
spawner: Spawner,
);
fn spawn_script_handler(
&mut self,
this: Arc<RwLock<dyn GameObject>>,
spawner: Spawner,
event: Event<'static, UserEvent<Arc<dyn Any + Send + Sync>>>,
);
fn get_globals(&self) -> Result<Box<dyn Global>, &'static str>;
fn set_globals(
&mut self,
globals: Box<dyn Global>,
) -> Result<(), &'static str>;
}Expand description
A trait that provides scriptable functionality.
Required Methods§
fn spawn_script_core( &mut self, this: Arc<RwLock<dyn GameObject>>, spawner: Spawner, )
fn spawn_script_handler( &mut self, this: Arc<RwLock<dyn GameObject>>, spawner: Spawner, event: Event<'static, UserEvent<Arc<dyn Any + Send + Sync>>>, )
fn get_globals(&self) -> Result<Box<dyn Global>, &'static str>
fn set_globals(&mut self, globals: Box<dyn Global>) -> Result<(), &'static str>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".