pub trait PluginGroup: Sized {
// Required method
fn build(self) -> PluginGroupBuilder;
// Provided methods
fn name() -> String { ... }
fn set<T>(self, plugin: T) -> PluginGroupBuilder
where T: Plugin { ... }
}Expand description
Combines multiple Plugins into a single unit.
If you want an easier, but slightly more restrictive, method of implementing this trait, you
may be interested in the plugin_group! macro.
Required Methods§
Sourcefn build(self) -> PluginGroupBuilder
fn build(self) -> PluginGroupBuilder
Configures the Plugins that are to be added.
Provided Methods§
Sourcefn name() -> String
fn name() -> String
Configures a name for the PluginGroup which is primarily used for debugging.
Sourcefn set<T>(self, plugin: T) -> PluginGroupBuilderwhere
T: Plugin,
fn set<T>(self, plugin: T) -> PluginGroupBuilderwhere
T: Plugin,
Sets the value of the given Plugin, if it exists
Examples found in repository?
More examples
examples/app/no_renderer.rs (lines 15-22)
12fn main() {
13 App::new()
14 .add_plugins(
15 DefaultPlugins.set(RenderPlugin {
16 render_creation: WgpuSettings {
17 backends: None,
18 ..default()
19 }
20 .into(),
21 ..default()
22 }),
23 )
24 .run();
25}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.