Trait ManageStaticScripts

Source
pub trait ManageStaticScripts {
    // Required methods
    fn add_static_script(&mut self, script_id: impl Into<ScriptId>) -> &mut Self;
    fn remove_static_script(
        &mut self,
        script_id: impl Into<ScriptId>,
    ) -> &mut Self;
}
Expand description

Trait for adding static scripts to an app

Required Methods§

Source

fn add_static_script(&mut self, script_id: impl Into<ScriptId>) -> &mut Self

Registers a script id as a static script.

Event handlers will run these scripts on top of the entity scripts.

Source

fn remove_static_script(&mut self, script_id: impl Into<ScriptId>) -> &mut Self

Removes a script id from the list of static scripts.

Does nothing if the script id is not in the list.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ManageStaticScripts for App

Source§

fn add_static_script(&mut self, script_id: impl Into<ScriptId>) -> &mut Self

Source§

fn remove_static_script(&mut self, script_id: impl Into<ScriptId>) -> &mut Self

Implementors§