pub struct SubApp {
pub update_schedule: Option<Interned<dyn ScheduleLabel>>,
/* private fields */
}
Expand description
A secondary application with its own World
. These can run independently of each other.
These are useful for situations where certain processes (e.g. a render thread) need to be kept separate from the main application.
§Example
#[derive(Resource, Default)]
struct Val(pub i32);
#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, AppLabel)]
struct ExampleApp;
// Create an app with a certain resource.
let mut app = App::new();
app.insert_resource(Val(10));
// Create a sub-app with the same resource and a single schedule.
let mut sub_app = SubApp::new();
sub_app.update_schedule = Some(Main.intern());
sub_app.insert_resource(Val(100));
// Setup an extract function to copy the resource's value in the main world.
sub_app.set_extract(|main_world, sub_world| {
sub_world.resource_mut::<Val>().0 = main_world.resource::<Val>().0;
});
// Schedule a system that will verify extraction is working.
sub_app.add_systems(Main, |counter: Res<Val>| {
// The value will be copied during extraction, so we should see 10 instead of 100.
assert_eq!(counter.0, 10);
});
// Add the sub-app to the main app.
app.insert_sub_app(ExampleApp, sub_app);
// Update the application once (using the default runner).
app.run();
Fields§
§update_schedule: Option<Interned<dyn ScheduleLabel>>
The schedule that will be run by update
.
Implementations§
Source§impl SubApp
impl SubApp
Sourcepub fn world(&self) -> &World
pub fn world(&self) -> &World
Returns a reference to the World
.
Examples found in repository?
More examples
45 fn finish(&self, app: &mut App) {
46 let Some(render_app) = app.get_sub_app_mut(RenderApp) else {
47 return;
48 };
49
50 let render_device = render_app.world().resource::<RenderDevice>();
51
52 // Check if the device support the required feature. If not, exit the example.
53 // In a real application, you should setup a fallback for the missing feature
54 if !render_device
55 .features()
56 .contains(WgpuFeatures::SAMPLED_TEXTURE_AND_STORAGE_BUFFER_ARRAY_NON_UNIFORM_INDEXING)
57 {
58 error!(
59 "Render device doesn't support feature \
60SAMPLED_TEXTURE_AND_STORAGE_BUFFER_ARRAY_NON_UNIFORM_INDEXING, \
61which is required for texture binding arrays"
62 );
63 exit(1);
64 }
65 }
Sourcepub fn world_mut(&mut self) -> &mut World
pub fn world_mut(&mut self) -> &mut World
Returns a mutable reference to the World
.
Examples found in repository?
More examples
46 fn finish(&self, app: &mut App) {
47 let render_app = app.sub_app_mut(RenderApp);
48 render_app.init_resource::<ComputePipeline>().add_systems(
49 Render,
50 prepare_bind_group
51 .in_set(RenderSet::PrepareBindGroups)
52 // We don't need to recreate the bind group every frame
53 .run_if(not(resource_exists::<GpuBufferBindGroup>)),
54 );
55
56 // Add the compute node as a top level node to the render graph
57 // This means it will only execute once per frame
58 render_app
59 .world_mut()
60 .resource_mut::<RenderGraph>()
61 .add_node(ComputeNodeLabel, ComputeNode::default());
62 }
101 fn build(&self, app: &mut App) {
102 // Extract the game of life image resource from the main world into the render world
103 // for operation on by the compute shader and display on the sprite.
104 app.add_plugins(ExtractResourcePlugin::<GameOfLifeImages>::default());
105 let render_app = app.sub_app_mut(RenderApp);
106 render_app.add_systems(
107 Render,
108 prepare_bind_group.in_set(RenderSet::PrepareBindGroups),
109 );
110
111 let mut render_graph = render_app.world_mut().resource_mut::<RenderGraph>();
112 render_graph.add_node(GameOfLifeLabel, GameOfLifeNode::default());
113 render_graph.add_node_edge(GameOfLifeLabel, bevy::render::graph::CameraDriverLabel);
114 }
203 fn build(&self, app: &mut App) {
204 let (s, r) = crossbeam_channel::unbounded();
205
206 let render_app = app
207 .insert_resource(MainWorldReceiver(r))
208 .sub_app_mut(RenderApp);
209
210 let mut graph = render_app.world_mut().resource_mut::<RenderGraph>();
211 graph.add_node(ImageCopy, ImageCopyDriver);
212 graph.add_node_edge(bevy::render::graph::CameraDriverLabel, ImageCopy);
213
214 render_app
215 .insert_resource(RenderWorldSender(s))
216 // Make ImageCopiers accessible in RenderWorld system and plugin
217 .add_systems(ExtractSchedule, image_copy_extract)
218 // Receives image data from buffer to channel
219 // so we need to run it after the render graph is done
220 .add_systems(Render, receive_image_from_buffer.after(RenderSet::Render));
221 }
Sourcepub fn run_default_schedule(&mut self)
pub fn run_default_schedule(&mut self)
Runs the default schedule.
Does not clear internal trackers used for change detection.
Sourcepub fn extract(&mut self, world: &mut World)
pub fn extract(&mut self, world: &mut World)
Extracts data from world
into the app’s world using the registered extract method.
Note: There is no default extract method. Calling extract
does nothing if
set_extract
has not been called.
Sourcepub fn set_extract<F>(&mut self, extract: F) -> &mut SubApp
pub fn set_extract<F>(&mut self, extract: F) -> &mut SubApp
Sets the method that will be called by extract
.
The first argument is the World
to extract data from, the second argument is the app World
.
Sourcepub fn take_extract(
&mut self,
) -> Option<Box<dyn Fn(&mut World, &mut World) + Send>>
pub fn take_extract( &mut self, ) -> Option<Box<dyn Fn(&mut World, &mut World) + Send>>
Take the function that will be called by extract
out of the app, if any was set,
and replace it with None
.
If you use Bevy, bevy_render
will set a default extract function used to extract data from
the main world into the render world as part of the Extract phase. In that case, you cannot replace
it with your own function. Instead, take the Bevy default function with this, and install your own
instead which calls the Bevy default.
let default_fn = app.take_extract();
app.set_extract(move |main, render| {
// Do pre-extract custom logic
// [...]
// Call Bevy's default, which executes the Extract phase
if let Some(f) = default_fn.as_ref() {
f(main, render);
}
// Do post-extract custom logic
// [...]
});
Sourcepub fn insert_resource<R>(&mut self, resource: R) -> &mut SubAppwhere
R: Resource,
pub fn insert_resource<R>(&mut self, resource: R) -> &mut SubAppwhere
R: Resource,
See App::insert_resource
.
Examples found in repository?
203 fn build(&self, app: &mut App) {
204 let (s, r) = crossbeam_channel::unbounded();
205
206 let render_app = app
207 .insert_resource(MainWorldReceiver(r))
208 .sub_app_mut(RenderApp);
209
210 let mut graph = render_app.world_mut().resource_mut::<RenderGraph>();
211 graph.add_node(ImageCopy, ImageCopyDriver);
212 graph.add_node_edge(bevy::render::graph::CameraDriverLabel, ImageCopy);
213
214 render_app
215 .insert_resource(RenderWorldSender(s))
216 // Make ImageCopiers accessible in RenderWorld system and plugin
217 .add_systems(ExtractSchedule, image_copy_extract)
218 // Receives image data from buffer to channel
219 // so we need to run it after the render graph is done
220 .add_systems(Render, receive_image_from_buffer.after(RenderSet::Render));
221 }
More examples
248 fn finish(&self, app: &mut App) {
249 // Create the `SavedIndirectParameters` resource that we're going to use
250 // to communicate between the thread that the GPU-to-CPU readback
251 // callback runs on and the main application threads. This resource is
252 // atomically reference counted. We store one reference to the
253 // `SavedIndirectParameters` in the main app and another reference in
254 // the render app.
255 let saved_indirect_parameters = SavedIndirectParameters::from_world(app.world_mut());
256 app.insert_resource(saved_indirect_parameters.clone());
257
258 // Fetch the render app.
259 let Some(render_app) = app.get_sub_app_mut(RenderApp) else {
260 return;
261 };
262
263 render_app
264 // Insert another reference to the `SavedIndirectParameters`.
265 .insert_resource(saved_indirect_parameters);
266 }
Sourcepub fn init_resource<R>(&mut self) -> &mut SubApp
pub fn init_resource<R>(&mut self) -> &mut SubApp
See App::init_resource
.
Examples found in repository?
More examples
99 fn build(&self, app: &mut App) {
100 app.add_plugins(ExtractComponentPlugin::<InstanceMaterialData>::default());
101 app.sub_app_mut(RenderApp)
102 .add_render_command::<Transparent3d, DrawCustom>()
103 .init_resource::<SpecializedMeshPipelines<CustomPipeline>>()
104 .add_systems(
105 Render,
106 (
107 queue_custom.in_set(RenderSet::QueueMeshes),
108 prepare_instance_buffers.in_set(RenderSet::PrepareResources),
109 ),
110 );
111 }
112
113 fn finish(&self, app: &mut App) {
114 app.sub_app_mut(RenderApp).init_resource::<CustomPipeline>();
115 }
46 fn finish(&self, app: &mut App) {
47 let render_app = app.sub_app_mut(RenderApp);
48 render_app.init_resource::<ComputePipeline>().add_systems(
49 Render,
50 prepare_bind_group
51 .in_set(RenderSet::PrepareBindGroups)
52 // We don't need to recreate the bind group every frame
53 .run_if(not(resource_exists::<GpuBufferBindGroup>)),
54 );
55
56 // Add the compute node as a top level node to the render graph
57 // This means it will only execute once per frame
58 render_app
59 .world_mut()
60 .resource_mut::<RenderGraph>()
61 .add_node(ComputeNodeLabel, ComputeNode::default());
62 }
109 fn build(&self, app: &mut App) {
110 app.add_plugins(ExtractComponentPlugin::<CustomRenderedEntity>::default());
111
112 // We make sure to add these to the render app, not the main app.
113 let Some(render_app) = app.get_sub_app_mut(RenderApp) else {
114 return;
115 };
116 render_app
117 // This is needed to tell bevy about your custom pipeline
118 .init_resource::<SpecializedMeshPipelines<CustomMeshPipeline>>()
119 // We need to use a custom draw command so we need to register it
120 .add_render_command::<Opaque3d, DrawSpecializedPipelineCommands>()
121 .add_systems(Render, queue_custom_mesh_pipeline.in_set(RenderSet::Queue));
122 }
123
124 fn finish(&self, app: &mut App) {
125 let Some(render_app) = app.get_sub_app_mut(RenderApp) else {
126 return;
127 };
128 // Creating this pipeline needs the RenderDevice and RenderQueue
129 // which are only available once rendering plugins are initialized.
130 render_app.init_resource::<CustomMeshPipeline>();
131 }
169fn main() {
170 let mut app = App::new();
171 app.add_plugins(DefaultPlugins)
172 .add_plugins(ExtractComponentPlugin::<CustomRenderedEntity>::default())
173 .add_systems(Startup, setup);
174
175 // We make sure to add these to the render app, not the main app.
176 app.get_sub_app_mut(RenderApp)
177 .unwrap()
178 .init_resource::<CustomPhasePipeline>()
179 .init_resource::<SpecializedRenderPipelines<CustomPhasePipeline>>()
180 .add_render_command::<Opaque3d, DrawCustomPhaseItemCommands>()
181 .add_systems(
182 Render,
183 prepare_custom_phase_item_buffers.in_set(RenderSet::Prepare),
184 )
185 .add_systems(Render, queue_custom_phase_item.in_set(RenderSet::Queue));
186
187 app.run();
188}
Sourcepub fn add_systems<M>(
&mut self,
schedule: impl ScheduleLabel,
systems: impl IntoScheduleConfigs<Box<dyn System<Out = Result<(), BevyError>, In = ()>>, M>,
) -> &mut SubApp
pub fn add_systems<M>( &mut self, schedule: impl ScheduleLabel, systems: impl IntoScheduleConfigs<Box<dyn System<Out = Result<(), BevyError>, In = ()>>, M>, ) -> &mut SubApp
See App::add_systems
.
Examples found in repository?
More examples
99 fn build(&self, app: &mut App) {
100 app.add_plugins(ExtractComponentPlugin::<InstanceMaterialData>::default());
101 app.sub_app_mut(RenderApp)
102 .add_render_command::<Transparent3d, DrawCustom>()
103 .init_resource::<SpecializedMeshPipelines<CustomPipeline>>()
104 .add_systems(
105 Render,
106 (
107 queue_custom.in_set(RenderSet::QueueMeshes),
108 prepare_instance_buffers.in_set(RenderSet::PrepareResources),
109 ),
110 );
111 }
46 fn finish(&self, app: &mut App) {
47 let render_app = app.sub_app_mut(RenderApp);
48 render_app.init_resource::<ComputePipeline>().add_systems(
49 Render,
50 prepare_bind_group
51 .in_set(RenderSet::PrepareBindGroups)
52 // We don't need to recreate the bind group every frame
53 .run_if(not(resource_exists::<GpuBufferBindGroup>)),
54 );
55
56 // Add the compute node as a top level node to the render graph
57 // This means it will only execute once per frame
58 render_app
59 .world_mut()
60 .resource_mut::<RenderGraph>()
61 .add_node(ComputeNodeLabel, ComputeNode::default());
62 }
109 fn build(&self, app: &mut App) {
110 app.add_plugins(ExtractComponentPlugin::<CustomRenderedEntity>::default());
111
112 // We make sure to add these to the render app, not the main app.
113 let Some(render_app) = app.get_sub_app_mut(RenderApp) else {
114 return;
115 };
116 render_app
117 // This is needed to tell bevy about your custom pipeline
118 .init_resource::<SpecializedMeshPipelines<CustomMeshPipeline>>()
119 // We need to use a custom draw command so we need to register it
120 .add_render_command::<Opaque3d, DrawSpecializedPipelineCommands>()
121 .add_systems(Render, queue_custom_mesh_pipeline.in_set(RenderSet::Queue));
122 }
101 fn build(&self, app: &mut App) {
102 // Extract the game of life image resource from the main world into the render world
103 // for operation on by the compute shader and display on the sprite.
104 app.add_plugins(ExtractResourcePlugin::<GameOfLifeImages>::default());
105 let render_app = app.sub_app_mut(RenderApp);
106 render_app.add_systems(
107 Render,
108 prepare_bind_group.in_set(RenderSet::PrepareBindGroups),
109 );
110
111 let mut render_graph = render_app.world_mut().resource_mut::<RenderGraph>();
112 render_graph.add_node(GameOfLifeLabel, GameOfLifeNode::default());
113 render_graph.add_node_edge(GameOfLifeLabel, bevy::render::graph::CameraDriverLabel);
114 }
Sourcepub fn register_system<I, O, M>(
&mut self,
system: impl IntoSystem<I, O, M> + 'static,
) -> SystemId<I, O>where
I: SystemInput + 'static,
O: 'static,
pub fn register_system<I, O, M>(
&mut self,
system: impl IntoSystem<I, O, M> + 'static,
) -> SystemId<I, O>where
I: SystemInput + 'static,
O: 'static,
See App::register_system
.
Sourcepub fn configure_sets<M>(
&mut self,
schedule: impl ScheduleLabel,
sets: impl IntoScheduleConfigs<Interned<dyn SystemSet>, M>,
) -> &mut SubApp
pub fn configure_sets<M>( &mut self, schedule: impl ScheduleLabel, sets: impl IntoScheduleConfigs<Interned<dyn SystemSet>, M>, ) -> &mut SubApp
See App::configure_sets
.
Sourcepub fn add_schedule(&mut self, schedule: Schedule) -> &mut SubApp
pub fn add_schedule(&mut self, schedule: Schedule) -> &mut SubApp
See App::add_schedule
.
Sourcepub fn init_schedule(&mut self, label: impl ScheduleLabel) -> &mut SubApp
pub fn init_schedule(&mut self, label: impl ScheduleLabel) -> &mut SubApp
See App::init_schedule
.
Sourcepub fn get_schedule(&self, label: impl ScheduleLabel) -> Option<&Schedule>
pub fn get_schedule(&self, label: impl ScheduleLabel) -> Option<&Schedule>
See App::get_schedule
.
Sourcepub fn get_schedule_mut(
&mut self,
label: impl ScheduleLabel,
) -> Option<&mut Schedule>
pub fn get_schedule_mut( &mut self, label: impl ScheduleLabel, ) -> Option<&mut Schedule>
Sourcepub fn edit_schedule(
&mut self,
label: impl ScheduleLabel,
f: impl FnMut(&mut Schedule),
) -> &mut SubApp
pub fn edit_schedule( &mut self, label: impl ScheduleLabel, f: impl FnMut(&mut Schedule), ) -> &mut SubApp
See App::edit_schedule
.
Sourcepub fn configure_schedules(
&mut self,
schedule_build_settings: ScheduleBuildSettings,
) -> &mut SubApp
pub fn configure_schedules( &mut self, schedule_build_settings: ScheduleBuildSettings, ) -> &mut SubApp
Sourcepub fn allow_ambiguous_component<T>(&mut self) -> &mut SubAppwhere
T: Component,
pub fn allow_ambiguous_component<T>(&mut self) -> &mut SubAppwhere
T: Component,
Sourcepub fn allow_ambiguous_resource<T>(&mut self) -> &mut SubAppwhere
T: Resource,
pub fn allow_ambiguous_resource<T>(&mut self) -> &mut SubAppwhere
T: Resource,
Sourcepub fn ignore_ambiguity<M1, M2, S1, S2>(
&mut self,
schedule: impl ScheduleLabel,
a: S1,
b: S2,
) -> &mut SubAppwhere
S1: IntoSystemSet<M1>,
S2: IntoSystemSet<M2>,
pub fn ignore_ambiguity<M1, M2, S1, S2>(
&mut self,
schedule: impl ScheduleLabel,
a: S1,
b: S2,
) -> &mut SubAppwhere
S1: IntoSystemSet<M1>,
S2: IntoSystemSet<M2>,
Sourcepub fn add_event<T>(&mut self) -> &mut SubAppwhere
T: Event,
pub fn add_event<T>(&mut self) -> &mut SubAppwhere
T: Event,
See App::add_event
.
Sourcepub fn add_plugins<M>(&mut self, plugins: impl Plugins<M>) -> &mut SubApp
pub fn add_plugins<M>(&mut self, plugins: impl Plugins<M>) -> &mut SubApp
See App::add_plugins
.
Sourcepub fn is_plugin_added<T>(&self) -> boolwhere
T: Plugin,
pub fn is_plugin_added<T>(&self) -> boolwhere
T: Plugin,
See App::is_plugin_added
.
Sourcepub fn get_added_plugins<T>(&self) -> Vec<&T>where
T: Plugin,
pub fn get_added_plugins<T>(&self) -> Vec<&T>where
T: Plugin,
Sourcepub fn plugins_state(&mut self) -> PluginsState
pub fn plugins_state(&mut self) -> PluginsState
Return the state of plugins.
Sourcepub fn finish(&mut self)
pub fn finish(&mut self)
Runs Plugin::finish
for each plugin.
Sourcepub fn cleanup(&mut self)
pub fn cleanup(&mut self)
Runs Plugin::cleanup
for each plugin.
Sourcepub fn register_type<T>(&mut self) -> &mut SubAppwhere
T: GetTypeRegistration,
pub fn register_type<T>(&mut self) -> &mut SubAppwhere
T: GetTypeRegistration,
See App::register_type
.
Sourcepub fn register_type_data<T, D>(&mut self) -> &mut SubApp
pub fn register_type_data<T, D>(&mut self) -> &mut SubApp
Sourcepub fn register_function<F, Marker>(&mut self, function: F) -> &mut SubAppwhere
F: IntoFunction<'static, Marker> + 'static,
pub fn register_function<F, Marker>(&mut self, function: F) -> &mut SubAppwhere
F: IntoFunction<'static, Marker> + 'static,
Sourcepub fn register_function_with_name<F, Marker>(
&mut self,
name: impl Into<Cow<'static, str>>,
function: F,
) -> &mut SubAppwhere
F: IntoFunction<'static, Marker> + 'static,
pub fn register_function_with_name<F, Marker>(
&mut self,
name: impl Into<Cow<'static, str>>,
function: F,
) -> &mut SubAppwhere
F: IntoFunction<'static, Marker> + 'static,
Trait Implementations§
Source§impl AddRenderCommand for SubApp
impl AddRenderCommand for SubApp
Source§fn add_render_command<P, C>(&mut self) -> &mut SubAppwhere
P: PhaseItem,
C: RenderCommand<P> + Send + Sync + 'static,
<C as RenderCommand<P>>::Param: ReadOnlySystemParam,
fn add_render_command<P, C>(&mut self) -> &mut SubAppwhere
P: PhaseItem,
C: RenderCommand<P> + Send + Sync + 'static,
<C as RenderCommand<P>>::Param: ReadOnlySystemParam,
RenderCommand
for the specified render phase to the app.Source§impl AppExtStates for SubApp
impl AppExtStates for SubApp
Source§fn init_state<S>(&mut self) -> &mut SubAppwhere
S: FreelyMutableState + FromWorld,
fn init_state<S>(&mut self) -> &mut SubAppwhere
S: FreelyMutableState + FromWorld,
Source§fn insert_state<S>(&mut self, state: S) -> &mut SubAppwhere
S: FreelyMutableState,
fn insert_state<S>(&mut self, state: S) -> &mut SubAppwhere
S: FreelyMutableState,
Source§fn add_computed_state<S>(&mut self) -> &mut SubAppwhere
S: ComputedStates,
fn add_computed_state<S>(&mut self) -> &mut SubAppwhere
S: ComputedStates,
ComputedStates
. Read moreSource§fn add_sub_state<S>(&mut self) -> &mut SubAppwhere
S: SubStates,
fn add_sub_state<S>(&mut self) -> &mut SubAppwhere
S: SubStates,
Source§fn enable_state_scoped_entities<S>(&mut self) -> &mut SubAppwhere
S: States,
fn enable_state_scoped_entities<S>(&mut self) -> &mut SubAppwhere
S: States,
S
. Read moreSource§fn register_type_state<S>(&mut self) -> &mut SubApp
fn register_type_state<S>(&mut self) -> &mut SubApp
T
using App::register_type
,
and adds ReflectState
type data to T
in the type registry. Read moreSource§fn register_type_mutable_state<S>(&mut self) -> &mut SubApp
fn register_type_mutable_state<S>(&mut self) -> &mut SubApp
T
using App::register_type
,
and adds crate::reflect::ReflectState
and crate::reflect::ReflectFreelyMutableState
type data to T
in the type registry. Read moreSource§impl RegisterDiagnostic for SubApp
impl RegisterDiagnostic for SubApp
Source§fn register_diagnostic(&mut self, diagnostic: Diagnostic) -> &mut SubApp
fn register_diagnostic(&mut self, diagnostic: Diagnostic) -> &mut SubApp
Source§impl RenderGraphApp for SubApp
impl RenderGraphApp for SubApp
Source§fn add_render_graph_node<T>(
&mut self,
sub_graph: impl RenderSubGraph,
node_label: impl RenderLabel,
) -> &mut SubApp
fn add_render_graph_node<T>( &mut self, sub_graph: impl RenderSubGraph, node_label: impl RenderLabel, ) -> &mut SubApp
Source§fn add_render_graph_edges<const N: usize>(
&mut self,
sub_graph: impl RenderSubGraph,
edges: impl IntoRenderNodeArray<N>,
) -> &mut SubApp
fn add_render_graph_edges<const N: usize>( &mut self, sub_graph: impl RenderSubGraph, edges: impl IntoRenderNodeArray<N>, ) -> &mut SubApp
Source§fn add_render_graph_edge(
&mut self,
sub_graph: impl RenderSubGraph,
output_node: impl RenderLabel,
input_node: impl RenderLabel,
) -> &mut SubApp
fn add_render_graph_edge( &mut self, sub_graph: impl RenderSubGraph, output_node: impl RenderLabel, input_node: impl RenderLabel, ) -> &mut SubApp
fn add_render_sub_graph( &mut self, sub_graph: impl RenderSubGraph, ) -> &mut SubApp
Source§impl StateScopedEventsAppExt for SubApp
impl StateScopedEventsAppExt for SubApp
Source§fn add_state_scoped_event<E>(
&mut self,
state: impl FreelyMutableState,
) -> &mut SubAppwhere
E: Event,
fn add_state_scoped_event<E>(
&mut self,
state: impl FreelyMutableState,
) -> &mut SubAppwhere
E: Event,
Auto Trait Implementations§
impl !Freeze for SubApp
impl !RefUnwindSafe for SubApp
impl Send for SubApp
impl !Sync for SubApp
impl Unpin for SubApp
impl !UnwindSafe for SubApp
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&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 Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&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
impl<T> DowncastSend for T
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self
using default()
.
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
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
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
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
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian()
.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.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
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.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
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.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
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.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
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.