pub trait SceneConstructor: Send + Sync {
// Required method
fn construct(&self, r: &mut RanimScene);
// Provided method
fn build_scene(&self) -> SealedRanimScene { ... }
}Expand description
A scene constructor
It can be a simple fn pointer of fn(&mut RanimScene),
or any type implements Fn(&mut RanimScene) + Send + Sync.
Required Methods§
Sourcefn construct(&self, r: &mut RanimScene)
fn construct(&self, r: &mut RanimScene)
The construct logic
Provided Methods§
Sourcefn build_scene(&self) -> SealedRanimScene
fn build_scene(&self) -> SealedRanimScene
Use the constructor to build a SealedRanimScene
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl SceneConstructor for Arc<dyn SceneConstructor>
impl SceneConstructor for Arc<dyn SceneConstructor>
fn construct(&self, r: &mut RanimScene)
Implementors§
impl SceneConstructor for Scene
impl<F: Fn(&mut RanimScene) + Send + Sync> SceneConstructor for F
impl<F: SceneConstructor> SceneConstructor for HotSceneConstructor<F>
Available on crate feature
subsecond and non-target_family=wasm only.