Skip to main content

AppExt

Trait AppExt 

Source
pub trait AppExt {
    // Required methods
    fn add_scene(&mut self, scene: Scene) -> &mut Self;
    fn scenes(&self) -> &[Scene];
    fn scene(&self, name: &str) -> Option<Scene>;

    // Provided methods
    fn add_scenes(
        &mut self,
        scenes: impl IntoIterator<Item = Scene>,
    ) -> &mut Self { ... }
    fn first_scene(&self) -> Option<Scene> { ... }
}
Expand description

Scene registration and selection for a project App.

Required Methods§

Source

fn add_scene(&mut self, scene: Scene) -> &mut Self

Register a scene without running its constructor.

§Panics

Panics if a scene with the same name is already registered.

Source

fn scenes(&self) -> &[Scene]

Return the scene descriptions in registration order.

Source

fn scene(&self, name: &str) -> Option<Scene>

Select a scene by name, cloning its descriptor.

Provided Methods§

Source

fn add_scenes(&mut self, scenes: impl IntoIterator<Item = Scene>) -> &mut Self

Register scenes in iteration order.

§Panics

Panics if any scene name is already registered, including duplicate names within this collection.

Source

fn first_scene(&self) -> Option<Scene>

Select the first registered scene, if the project has any scenes.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§