Struct GameTestFunctions
pub struct GameTestFunctions { /* private fields */ }Expand description
Load-owned function registry. Duplicate and invalid identifiers are refused.
Implementations§
§impl GameTestFunctions
impl GameTestFunctions
pub fn definitions(&self) -> impl Iterator<Item = (&str, &GameTestDefinition)>
pub fn definitions(&self) -> impl Iterator<Item = (&str, &GameTestDefinition)>
Test definitions collected at world load, in identifier order.
pub fn resolve(&self, id: &str) -> Option<Arc<dyn GameTestFunction>>
pub fn resolve(&self, id: &str) -> Option<Arc<dyn GameTestFunction>>
Resolve once when a test definition loads. The callback remains owned by that definition.
Trait Implementations§
§impl Clone for GameTestFunctions
impl Clone for GameTestFunctions
§fn clone(&self) -> GameTestFunctions
fn clone(&self) -> GameTestFunctions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Default for GameTestFunctions
impl Default for GameTestFunctions
§fn default() -> GameTestFunctions
fn default() -> GameTestFunctions
Returns the “default value” for a type. Read more
§impl GameTests for GameTestFunctions
impl GameTests for GameTestFunctions
§fn register(
&mut self,
id: &str,
function: Arc<dyn GameTestFunction>,
) -> Result<(), &'static str>
fn register( &mut self, id: &str, function: Arc<dyn GameTestFunction>, ) -> Result<(), &'static str>
Register a namespaced function. Vanilla identifiers are reserved.
§fn register_test(
&mut self,
id: &str,
definition: GameTestDefinition,
) -> Result<(), &'static str>
fn register_test( &mut self, id: &str, definition: GameTestDefinition, ) -> Result<(), &'static str>
Register a test instance; duplicate ids and invalid timing are refused.
Auto Trait Implementations§
impl !RefUnwindSafe for GameTestFunctions
impl !UnwindSafe for GameTestFunctions
impl Freeze for GameTestFunctions
impl Send for GameTestFunctions
impl Sync for GameTestFunctions
impl Unpin for GameTestFunctions
impl UnsafeUnpin for GameTestFunctions
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