Skip to main content

PluginGroupBuilder

Struct PluginGroupBuilder 

Source
pub struct PluginGroupBuilder { /* private fields */ }
Expand description

Facilitates the creation and configuration of a PluginGroup.

Provides a build ordering to ensure that Plugins which produce/require a Resource are built before/after dependent/depending Plugins. Plugins inside the group can be disabled, enabled or reordered.

Implementations§

Source§

impl PluginGroupBuilder

Source

pub fn start<PG>() -> PluginGroupBuilder
where PG: PluginGroup,

Start a new builder for the PluginGroup.

Examples found in repository?
examples/app/plugin_group.rs (line 31)
30    fn build(self) -> PluginGroupBuilder {
31        PluginGroupBuilder::start::<Self>()
32            .add(PrintHelloPlugin)
33            .add(PrintWorldPlugin)
34    }
Source

pub fn contains<T>(&self) -> bool
where T: Plugin,

Checks if the PluginGroupBuilder contains the given Plugin.

Source

pub fn enabled<T>(&self) -> bool
where T: Plugin,

Returns true if the PluginGroupBuilder contains the given Plugin and it’s enabled.

Source

pub fn set<T>(self, plugin: T) -> PluginGroupBuilder
where T: Plugin,

Sets the value of the given Plugin, if it exists.

§Panics

Panics if the Plugin does not exist.

Examples found in repository?
examples/shader/compute_shader_game_of_life.rs (line 46)
32fn main() {
33    App::new()
34        .insert_resource(ClearColor(Color::BLACK))
35        .add_plugins((
36            DefaultPlugins
37                .set(WindowPlugin {
38                    primary_window: Some(Window {
39                        resolution: (SIZE * DISPLAY_FACTOR).into(),
40                        // uncomment for unthrottled FPS
41                        // present_mode: bevy::window::PresentMode::AutoNoVsync,
42                        ..default()
43                    }),
44                    ..default()
45                })
46                .set(ImagePlugin::default_nearest()),
47            GameOfLifeComputePlugin,
48        ))
49        .add_systems(Startup, setup)
50        .add_systems(Update, switch_textures)
51        .run();
52}
More examples
Hide additional examples
examples/gltf/gltf_extension_mesh_2d.rs (lines 46-49)
29fn main() {
30    App::new()
31        .insert_resource(GlobalAmbientLight {
32            color: Color::WHITE,
33            brightness: 2000.,
34            ..default()
35        })
36        .add_plugins((
37            DefaultPlugins
38                .set(
39                    GltfPlugin::default()
40                        // Map a custom glTF attribute name to a `MeshVertexAttribute`.
41                        // The glTF file used here has an attribute name with *two*
42                        // underscores: __BARYCENTRIC
43                        // One is stripped to do the comparison here.
44                        .add_custom_vertex_attribute("_BARYCENTRIC", ATTRIBUTE_BARYCENTRIC),
45                )
46                .set(PbrPlugin {
47                    gltf_enable_standard_materials: false,
48                    ..Default::default()
49                }),
50            GltfToMesh2dPlugin,
51        ))
52        .add_systems(Startup, setup)
53        .run();
54}
examples/3d/clustered_decal_maps.rs (lines 145-151)
138fn main() {
139    App::new()
140        .add_plugins((
141            DefaultPlugins
142                .set(WebAssetPlugin {
143                    silence_startup_warning: true,
144                })
145                .set(WindowPlugin {
146                    primary_window: Some(Window {
147                        title: "Bevy Clustered Decal Maps Example".into(),
148                        ..default()
149                    }),
150                    ..default()
151                }),
152            FeathersPlugins,
153        ))
154        .init_resource::<AppStatus>()
155        .init_resource::<AppTextures>()
156        .insert_resource(UiTheme(create_dark_theme()))
157        .add_systems(Startup, setup)
158        .add_systems(Update, draw_gizmos)
159        .add_systems(Update, spawn_decal)
160        .add_systems(Update, animate_decals)
161        .add_observer(handle_emission_type_change)
162        .add_observer(radio_self_update)
163        .insert_resource(SeededRng(ChaCha8Rng::seed_from_u64(19878367467712)))
164        .run();
165}
examples/3d/occlusion_culling.rs (lines 187-190)
174fn main() {
175    let render_debug_flags = RenderDebugFlags::ALLOW_COPIES_FROM_INDIRECT_PARAMETERS;
176
177    App::new()
178        .add_plugins((
179            DefaultPlugins
180                .set(WindowPlugin {
181                    primary_window: Some(Window {
182                        title: "Bevy Occlusion Culling Example".into(),
183                        ..default()
184                    }),
185                    ..default()
186                })
187                .set(RenderPlugin {
188                    debug_flags: render_debug_flags,
189                    ..default()
190                })
191                .set(PbrPlugin {
192                    debug_flags: render_debug_flags,
193                    ..default()
194                }),
195            FeathersPlugins,
196        ))
197        .add_plugins(ReadbackIndirectParametersPlugin)
198        .insert_resource(UiTheme(theme::basic_example_theme(Color::WHITE)))
199        .init_resource::<AppStatus>()
200        .add_systems(Startup, setup)
201        .add_systems(Update, spin_small_cubes)
202        .add_systems(Update, spin_large_cube)
203        .add_systems(Update, update_status_text)
204        .add_observer(handle_selection_change)
205        .add_observer(radio_self_update)
206        .run();
207}
examples/app/externally_driven_headless_renderer.rs (line 58)
39    fn new() -> Self {
40        let render_plugin = RenderPlugin {
41            // Make sure all shaders are loaded for the first frame
42            synchronous_pipeline_compilation: true,
43            ..default()
44        };
45        // We don't have any windows, but the WindowPlugin is still needed
46        // because a lot of bevy expects it to be there. Just configure it
47        // to not have any windows and not exit automatically.
48        let window_plugin = WindowPlugin {
49            primary_window: None,
50            exit_condition: ExitCondition::DontExit,
51            ..default()
52        };
53
54        let mut app = App::new();
55        app.add_plugins(
56            DefaultPlugins
57                .set(window_plugin)
58                .set(render_plugin)
59                // Disable winit because we want to own the update loop ourselves.
60                .disable::<WinitPlugin>(),
61        )
62        .add_systems(Startup, spawn_test_scene)
63        .add_systems(Update, update_camera);
64
65        // We yeet the schedule runner and never call app.run(),
66        // so we have to finish and clean up ourselves
67        app.finish();
68        app.cleanup();
69
70        // We grab the sub apps cus we dont want the runner, as we'll
71        // be pumping the update loop ourselves manually.
72        Self(std::mem::take(app.sub_apps_mut()))
73    }
examples/stress_tests/many_morph_targets.rs (lines 160-167)
140fn main() {
141    // `from_env` panics on the web
142    #[cfg(not(target_arch = "wasm32"))]
143    let args: Args = argh::from_env();
144    #[cfg(target_arch = "wasm32")]
145    let args = Args::from_args(&[], &[]).unwrap();
146
147    App::new()
148        .add_plugins((
149            DefaultPlugins
150                .set(WindowPlugin {
151                    primary_window: Some(Window {
152                        title: "Many Morph Targets".to_string(),
153                        present_mode: PresentMode::AutoNoVsync,
154                        resolution: WindowResolution::new(1920, 1080)
155                            .with_scale_factor_override(1.0),
156                        ..default()
157                    }),
158                    ..default()
159                })
160                .set(GltfPlugin {
161                    mesh_compression: if args.mesh_compression {
162                        MeshCompressionArgs::regular()
163                    } else {
164                        MeshCompressionArgs::none()
165                    },
166                    ..default()
167                }),
168            FrameTimeDiagnosticsPlugin::default(),
169            LogDiagnosticsPlugin::default(),
170        ))
171        .insert_resource(WinitSettings::continuous())
172        .insert_resource(GlobalAmbientLight {
173            brightness: 1000.0,
174            ..default()
175        })
176        .insert_resource(MorphAssets::default())
177        .insert_resource(Rng(ChaCha8Rng::seed_from_u64(856673)))
178        .insert_resource(State::new(&args))
179        .insert_resource(args)
180        .add_systems(Startup, setup)
181        .add_systems(Update, update)
182        .run();
183}
Source

pub fn try_set<T>( self, plugin: T, ) -> Result<PluginGroupBuilder, (PluginGroupBuilder, T)>
where T: Plugin,

Tries to set the value of the given Plugin, if it exists.

If the given plugin doesn’t exist returns self and the passed in Plugin.

Source

pub fn add<T>(self, plugin: T) -> PluginGroupBuilder
where T: Plugin,

Adds the plugin Plugin at the end of this PluginGroupBuilder. If the plugin was already in the group, it is removed from its previous place.

Examples found in repository?
examples/app/plugin_group.rs (line 32)
30    fn build(self) -> PluginGroupBuilder {
31        PluginGroupBuilder::start::<Self>()
32            .add(PrintHelloPlugin)
33            .add(PrintWorldPlugin)
34    }
Source

pub fn try_add<T>( self, plugin: T, ) -> Result<PluginGroupBuilder, (PluginGroupBuilder, T)>
where T: Plugin,

Attempts to add the plugin Plugin at the end of this PluginGroupBuilder.

If the plugin was already in the group the addition fails.

Source

pub fn add_group(self, group: impl PluginGroup) -> PluginGroupBuilder

Adds a PluginGroup at the end of this PluginGroupBuilder. If the plugin was already in the group, it is removed from its previous place.

Source

pub fn add_before<Target>(self, plugin: impl Plugin) -> PluginGroupBuilder
where Target: Plugin,

Adds a Plugin in this PluginGroupBuilder before the plugin of type Target.

If the plugin was already the group, it is removed from its previous place.

§Panics

Panics if Target is not already in this PluginGroupBuilder.

Source

pub fn try_add_before<Target, Insert>( self, plugin: Insert, ) -> Result<PluginGroupBuilder, (PluginGroupBuilder, Insert)>
where Target: Plugin, Insert: Plugin,

Adds a Plugin in this PluginGroupBuilder before the plugin of type Target.

If the plugin was already in the group the add fails. If there isn’t a plugin of type Target in the group the plugin we’re trying to insert is returned.

Source

pub fn try_add_before_overwrite<Target, Insert>( self, plugin: Insert, ) -> Result<PluginGroupBuilder, (PluginGroupBuilder, Insert)>
where Target: Plugin, Insert: Plugin,

Adds a Plugin in this PluginGroupBuilder before the plugin of type Target.

If the plugin was already in the group, it is removed from its previous places. If there isn’t a plugin of type Target in the group the plugin we’re trying to insert is returned.

Source

pub fn add_after<Target>(self, plugin: impl Plugin) -> PluginGroupBuilder
where Target: Plugin,

Adds a Plugin in this PluginGroupBuilder after the plugin of type Target.

If the plugin was already the group, it is removed from its previous place.

§Panics

Panics if Target is not already in this PluginGroupBuilder.

Source

pub fn try_add_after<Target, Insert>( self, plugin: Insert, ) -> Result<PluginGroupBuilder, (PluginGroupBuilder, Insert)>
where Target: Plugin, Insert: Plugin,

Adds a Plugin in this PluginGroupBuilder after the plugin of type Target.

If the plugin was already in the group the add fails. If there isn’t a plugin of type Target in the group the plugin we’re trying to insert is returned.

Source

pub fn try_add_after_overwrite<Target, Insert>( self, plugin: Insert, ) -> Result<PluginGroupBuilder, (PluginGroupBuilder, Insert)>
where Target: Plugin, Insert: Plugin,

Adds a Plugin in this PluginGroupBuilder after the plugin of type Target.

If the plugin was already in the group, it is removed from its previous places. If there isn’t a plugin of type Target in the group the plugin we’re trying to insert is returned.

Source

pub fn enable<T>(self) -> PluginGroupBuilder
where T: Plugin,

Enables a Plugin.

Plugins within a PluginGroup are enabled by default. This function is used to opt back in to a Plugin after disabling it. If there are no plugins of type T in this group, it will panic.

Source

pub fn disable<T>(self) -> PluginGroupBuilder
where T: Plugin,

Disables a Plugin, preventing it from being added to the App with the rest of the PluginGroup. The disabled Plugin keeps its place in the PluginGroup, so it can still be used for ordering with add_before or add_after, or it can be re-enabled. If there are no plugins of type T in this group, it will panic.

Examples found in repository?
examples/2d/mesh2d_repeated_texture.rs (line 20)
18fn main() {
19    App::new()
20        .add_plugins(DefaultPlugins.build().disable::<AudioPlugin>())
21        .add_systems(Startup, setup)
22        .run();
23}
More examples
Hide additional examples
examples/app/without_winit.rs (line 7)
5fn main() {
6    App::new()
7        .add_plugins(DefaultPlugins.build().disable::<WinitPlugin>())
8        .add_systems(Update, setup_system)
9        .run();
10}
examples/gltf/edit_material_on_gltf.rs (line 10)
8fn main() {
9    App::new()
10        .add_plugins(DefaultPlugins.build().disable::<AudioPlugin>())
11        .add_systems(Startup, setup_scene)
12        .add_observer(change_material)
13        .run();
14}
examples/app/headless.rs (line 42)
16fn main() {
17    if cfg!(feature = "bevy_window") {
18        println!("This example is running with the bevy_window feature enabled and will not run headless.");
19        println!("Disable the default features and rerun the example to run headless.");
20        println!("To do so, run:");
21        println!();
22        println!("    cargo run --example headless --no-default-features --features bevy_log");
23        return;
24    }
25
26    // This app runs once
27    App::new()
28        .add_plugins(DefaultPlugins.set(ScheduleRunnerPlugin::run_once()))
29        .add_systems(Update, hello_world_system)
30        .run();
31
32    // This app loops forever at 60 fps
33    App::new()
34        .add_plugins(
35            DefaultPlugins
36                .set(ScheduleRunnerPlugin::run_loop(Duration::from_secs_f64(
37                    1.0 / 60.0,
38                )))
39                // The log and ctrl+c plugin can only be registered once globally,
40                // which means we need to disable it here, because it was already registered with the
41                // app that runs once.
42                .disable::<LogPlugin>(),
43        )
44        .add_systems(Update, counter)
45        .run();
46}
examples/app/externally_driven_headless_renderer.rs (line 60)
39    fn new() -> Self {
40        let render_plugin = RenderPlugin {
41            // Make sure all shaders are loaded for the first frame
42            synchronous_pipeline_compilation: true,
43            ..default()
44        };
45        // We don't have any windows, but the WindowPlugin is still needed
46        // because a lot of bevy expects it to be there. Just configure it
47        // to not have any windows and not exit automatically.
48        let window_plugin = WindowPlugin {
49            primary_window: None,
50            exit_condition: ExitCondition::DontExit,
51            ..default()
52        };
53
54        let mut app = App::new();
55        app.add_plugins(
56            DefaultPlugins
57                .set(window_plugin)
58                .set(render_plugin)
59                // Disable winit because we want to own the update loop ourselves.
60                .disable::<WinitPlugin>(),
61        )
62        .add_systems(Startup, spawn_test_scene)
63        .add_systems(Update, update_camera);
64
65        // We yeet the schedule runner and never call app.run(),
66        // so we have to finish and clean up ourselves
67        app.finish();
68        app.cleanup();
69
70        // We grab the sub apps cus we dont want the runner, as we'll
71        // be pumping the update loop ourselves manually.
72        Self(std::mem::take(app.sub_apps_mut()))
73    }
examples/app/headless_renderer.rs (line 98)
70fn main() {
71    let config = AppConfig {
72        width: 1920,
73        height: 1080,
74        single_image: true,
75    };
76
77    // setup frame capture
78    App::new()
79        .insert_resource(SceneController::new(
80            config.width,
81            config.height,
82            config.single_image,
83        ))
84        .insert_resource(ClearColor(Color::srgb_u8(0, 0, 0)))
85        .add_plugins(
86            DefaultPlugins
87                .set(ImagePlugin::default_nearest())
88                // Not strictly necessary, as the inclusion of ScheduleRunnerPlugin below
89                // replaces the bevy_winit app runner and so a window is never created.
90                .set(WindowPlugin {
91                    primary_window: None,
92                    // Don’t automatically exit due to having no windows.
93                    // Instead, the code in `update()` will explicitly produce an `AppExit` event.
94                    exit_condition: ExitCondition::DontExit,
95                    ..default()
96                })
97                // WinitPlugin will panic in environments without a display server.
98                .disable::<WinitPlugin>(),
99        )
100        .add_plugins(ImageCopyPlugin)
101        // headless frame capture
102        .add_plugins(CaptureFramePlugin)
103        // ScheduleRunnerPlugin provides an alternative to the default bevy_winit app runner, which
104        // manages the loop without creating a window.
105        .add_plugins(ScheduleRunnerPlugin::run_loop(
106            // Run 60 times per second.
107            Duration::from_secs_f64(1.0 / 60.0),
108        ))
109        .init_resource::<SceneController>()
110        .add_systems(Startup, setup)
111        .run();
112}
Source

pub fn finish(self, app: &mut App)

Consumes the PluginGroupBuilder and builds the contained Plugins in the order specified.

§Panics

Panics if one of the plugin in the group was already added to the application.

Trait Implementations§

Source§

impl PluginGroup for PluginGroupBuilder

Source§

fn build(self) -> PluginGroupBuilder

Configures the Plugins that are to be added.
Source§

fn name() -> String

Configures a name for the PluginGroup which is primarily used for debugging.
Source§

fn set<T>(self, plugin: T) -> PluginGroupBuilder
where T: Plugin,

Sets the value of the given Plugin, if it exists

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T, U> AsBindGroupShaderType<U> for T
where U: ShaderType, &'a T: for<'a> Into<U>,

Source§

fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U

Return the T ShaderType for self. When used in AsBindGroup derives, it is safe to assume that all images in self exist.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> ConditionalSend for T
where T: Send,

Source§

impl<T> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

Source§

const WITNESS: W = W::MAKE

A constant of the type witness
Source§

impl<T> Identity for T
where T: ?Sized,

Source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
Source§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
Source§

impl<T> InitializeFromFunction<T> for T

Source§

fn initialize_from_function(f: fn() -> T) -> T

Create an instance of this type from an initialization function
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> IntoResult<T> for T

Source§

fn into_result(self) -> Result<T, RunSystemError>

Converts this type into the system output type.
Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<A> Is for A
where A: Any,

Source§

fn is<T>() -> bool
where T: Any,

Checks if the current type “is” another type, using a TypeId equality comparison. This is most useful in the context of generic logic. Read more
Source§

impl<T> Pipe for T
where T: ?Sized,

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
Source§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
Source§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<Marker, T> Plugins<Marker> for T
where T: Plugins<Marker>,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Settings for T
where T: 'static + Send + Sync,

Source§

impl<Ret> SpawnIfAsync<(), Ret> for Ret

Source§

fn spawn(self) -> Ret

Spawn the value into the dioxus runtime if it is an async block
Source§

impl<T, O> SuperFrom<T> for O
where O: From<T>,

Source§

fn super_from(input: T) -> O

Convert from a type to another type.
Source§

impl<T, O, M> SuperInto<O, M> for T
where O: SuperFrom<T, M>,

Source§

fn super_into(self) -> O

Convert from a type to another type.
Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more