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.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?
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
fn finish(&self, app: &mut App) {
let Some(render_app) = app.get_sub_app_mut(RenderApp) else {
return;
};
let render_device = render_app.world().resource::<RenderDevice>();
// Check if the device support the required feature. If not, exit the example.
// In a real application, you should setup a fallback for the missing feature
if !render_device
.features()
.contains(WgpuFeatures::SAMPLED_TEXTURE_AND_STORAGE_BUFFER_ARRAY_NON_UNIFORM_INDEXING)
{
error!(
"Render device doesn't support feature \
SAMPLED_TEXTURE_AND_STORAGE_BUFFER_ARRAY_NON_UNIFORM_INDEXING, \
which is required for texture binding arrays"
);
exit(1);
}
}
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?
103 104 105 106 107 108 109 110 111 112 113 114 115 116
fn build(&self, app: &mut App) {
// Extract the game of life image resource from the main world into the render world
// for operation on by the compute shader and display on the sprite.
app.add_plugins(ExtractResourcePlugin::<GameOfLifeImages>::default());
let render_app = app.sub_app_mut(RenderApp);
render_app.add_systems(
Render,
prepare_bind_group.in_set(RenderSet::PrepareBindGroups),
);
let mut render_graph = render_app.world_mut().resource_mut::<RenderGraph>();
render_graph.add_node(GameOfLifeLabel, GameOfLifeNode::default());
render_graph.add_node_edge(GameOfLifeLabel, bevy::render::graph::CameraDriverLabel);
}
More examples
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219
fn build(&self, app: &mut App) {
let (s, r) = crossbeam_channel::unbounded();
let render_app = app
.insert_resource(MainWorldReceiver(r))
.sub_app_mut(RenderApp);
let mut graph = render_app.world_mut().resource_mut::<RenderGraph>();
graph.add_node(ImageCopy, ImageCopyDriver);
graph.add_node_edge(bevy::render::graph::CameraDriverLabel, ImageCopy);
render_app
.insert_resource(RenderWorldSender(s))
// Make ImageCopiers accessible in RenderWorld system and plugin
.add_systems(ExtractSchedule, image_copy_extract)
// Receives image data from buffer to channel
// so we need to run it after the render graph is done
.add_systems(Render, receive_image_from_buffer.after(RenderSet::Render));
}
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
fn finish(&self, app: &mut App) {
let (s, r) = crossbeam_channel::unbounded();
app.insert_resource(MainWorldReceiver(r));
let render_app = app.sub_app_mut(RenderApp);
render_app
.insert_resource(RenderWorldSender(s))
.init_resource::<ComputePipeline>()
.init_resource::<Buffers>()
.add_systems(
Render,
(
prepare_bind_group
.in_set(RenderSet::PrepareBindGroups)
// We don't need to recreate the bind group every frame
.run_if(not(resource_exists::<GpuBufferBindGroup>)),
// We need to run it after the render graph is done
// because this needs to happen after submit()
map_and_read_buffer.after(RenderSet::Render),
),
);
// Add the compute node as a top level node to the render graph
// This means it will only execute once per frame
render_app
.world_mut()
.resource_mut::<RenderGraph>()
.add_node(ComputeNodeLabel, ComputeNode::default());
}
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 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?
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219
fn build(&self, app: &mut App) {
let (s, r) = crossbeam_channel::unbounded();
let render_app = app
.insert_resource(MainWorldReceiver(r))
.sub_app_mut(RenderApp);
let mut graph = render_app.world_mut().resource_mut::<RenderGraph>();
graph.add_node(ImageCopy, ImageCopyDriver);
graph.add_node_edge(bevy::render::graph::CameraDriverLabel, ImageCopy);
render_app
.insert_resource(RenderWorldSender(s))
// Make ImageCopiers accessible in RenderWorld system and plugin
.add_systems(ExtractSchedule, image_copy_extract)
// Receives image data from buffer to channel
// so we need to run it after the render graph is done
.add_systems(Render, receive_image_from_buffer.after(RenderSet::Render));
}
More examples
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
fn finish(&self, app: &mut App) {
let (s, r) = crossbeam_channel::unbounded();
app.insert_resource(MainWorldReceiver(r));
let render_app = app.sub_app_mut(RenderApp);
render_app
.insert_resource(RenderWorldSender(s))
.init_resource::<ComputePipeline>()
.init_resource::<Buffers>()
.add_systems(
Render,
(
prepare_bind_group
.in_set(RenderSet::PrepareBindGroups)
// We don't need to recreate the bind group every frame
.run_if(not(resource_exists::<GpuBufferBindGroup>)),
// We need to run it after the render graph is done
// because this needs to happen after submit()
map_and_read_buffer.after(RenderSet::Render),
),
);
// Add the compute node as a top level node to the render graph
// This means it will only execute once per frame
render_app
.world_mut()
.resource_mut::<RenderGraph>()
.add_node(ComputeNodeLabel, ComputeNode::default());
}
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
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
fn build(&self, app: &mut App) {
app.add_plugins(ExtractComponentPlugin::<InstanceMaterialData>::default());
app.sub_app_mut(RenderApp)
.add_render_command::<Transparent3d, DrawCustom>()
.init_resource::<SpecializedMeshPipelines<CustomPipeline>>()
.add_systems(
Render,
(
queue_custom.in_set(RenderSet::QueueMeshes),
prepare_instance_buffers.in_set(RenderSet::PrepareResources),
),
);
}
fn finish(&self, app: &mut App) {
app.sub_app_mut(RenderApp).init_resource::<CustomPipeline>();
}
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307
fn build(&self, app: &mut App) {
// Load our custom shader
let mut shaders = app.world_mut().resource_mut::<Assets<Shader>>();
shaders.insert(
&COLORED_MESH2D_SHADER_HANDLE,
Shader::from_wgsl(COLORED_MESH2D_SHADER, file!()),
);
// Register our custom draw function, and add our render systems
app.get_sub_app_mut(RenderApp)
.unwrap()
.add_render_command::<Transparent2d, DrawColoredMesh2d>()
.init_resource::<SpecializedRenderPipelines<ColoredMesh2dPipeline>>()
.init_resource::<RenderColoredMesh2dInstances>()
.add_systems(
ExtractSchedule,
extract_colored_mesh2d.after(extract_mesh2d),
)
.add_systems(Render, queue_colored_mesh2d.in_set(RenderSet::QueueMeshes));
}
fn finish(&self, app: &mut App) {
// Register our custom pipeline
app.get_sub_app_mut(RenderApp)
.unwrap()
.init_resource::<ColoredMesh2dPipeline>();
}
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
fn main() {
let mut app = App::new();
app.add_plugins(DefaultPlugins)
.add_plugins(ExtractComponentPlugin::<CustomRenderedEntity>::default())
.add_systems(Startup, setup)
// Make sure to tell Bevy to check our entity for visibility. Bevy won't
// do this by default, for efficiency reasons.
.add_systems(
PostUpdate,
view::check_visibility::<WithCustomRenderedEntity>
.in_set(VisibilitySystems::CheckVisibility),
);
// We make sure to add these to the render app, not the main app.
app.get_sub_app_mut(RenderApp)
.unwrap()
.init_resource::<CustomPhasePipeline>()
.init_resource::<SpecializedRenderPipelines<CustomPhasePipeline>>()
.add_render_command::<Opaque3d, DrawCustomPhaseItemCommands>()
.add_systems(
Render,
prepare_custom_phase_item_buffers.in_set(RenderSet::Prepare),
)
.add_systems(Render, queue_custom_phase_item.in_set(RenderSet::Queue));
app.run();
}
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
fn finish(&self, app: &mut App) {
let (s, r) = crossbeam_channel::unbounded();
app.insert_resource(MainWorldReceiver(r));
let render_app = app.sub_app_mut(RenderApp);
render_app
.insert_resource(RenderWorldSender(s))
.init_resource::<ComputePipeline>()
.init_resource::<Buffers>()
.add_systems(
Render,
(
prepare_bind_group
.in_set(RenderSet::PrepareBindGroups)
// We don't need to recreate the bind group every frame
.run_if(not(resource_exists::<GpuBufferBindGroup>)),
// We need to run it after the render graph is done
// because this needs to happen after submit()
map_and_read_buffer.after(RenderSet::Render),
),
);
// Add the compute node as a top level node to the render graph
// This means it will only execute once per frame
render_app
.world_mut()
.resource_mut::<RenderGraph>()
.add_node(ComputeNodeLabel, ComputeNode::default());
}
sourcepub fn add_systems<M>(
&mut self,
schedule: impl ScheduleLabel,
systems: impl IntoSystemConfigs<M>,
) -> &mut SubApp
pub fn add_systems<M>( &mut self, schedule: impl ScheduleLabel, systems: impl IntoSystemConfigs<M>, ) -> &mut SubApp
See App::add_systems
.
Examples found in repository?
More examples
83 84 85 86 87 88 89 90 91 92 93 94 95
fn build(&self, app: &mut App) {
app.add_plugins(ExtractComponentPlugin::<InstanceMaterialData>::default());
app.sub_app_mut(RenderApp)
.add_render_command::<Transparent3d, DrawCustom>()
.init_resource::<SpecializedMeshPipelines<CustomPipeline>>()
.add_systems(
Render,
(
queue_custom.in_set(RenderSet::QueueMeshes),
prepare_instance_buffers.in_set(RenderSet::PrepareResources),
),
);
}
103 104 105 106 107 108 109 110 111 112 113 114 115 116
fn build(&self, app: &mut App) {
// Extract the game of life image resource from the main world into the render world
// for operation on by the compute shader and display on the sprite.
app.add_plugins(ExtractResourcePlugin::<GameOfLifeImages>::default());
let render_app = app.sub_app_mut(RenderApp);
render_app.add_systems(
Render,
prepare_bind_group.in_set(RenderSet::PrepareBindGroups),
);
let mut render_graph = render_app.world_mut().resource_mut::<RenderGraph>();
render_graph.add_node(GameOfLifeLabel, GameOfLifeNode::default());
render_graph.add_node_edge(GameOfLifeLabel, bevy::render::graph::CameraDriverLabel);
}
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219
fn build(&self, app: &mut App) {
let (s, r) = crossbeam_channel::unbounded();
let render_app = app
.insert_resource(MainWorldReceiver(r))
.sub_app_mut(RenderApp);
let mut graph = render_app.world_mut().resource_mut::<RenderGraph>();
graph.add_node(ImageCopy, ImageCopyDriver);
graph.add_node_edge(bevy::render::graph::CameraDriverLabel, ImageCopy);
render_app
.insert_resource(RenderWorldSender(s))
// Make ImageCopiers accessible in RenderWorld system and plugin
.add_systems(ExtractSchedule, image_copy_extract)
// Receives image data from buffer to channel
// so we need to run it after the render graph is done
.add_systems(Render, receive_image_from_buffer.after(RenderSet::Render));
}
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300
fn build(&self, app: &mut App) {
// Load our custom shader
let mut shaders = app.world_mut().resource_mut::<Assets<Shader>>();
shaders.insert(
&COLORED_MESH2D_SHADER_HANDLE,
Shader::from_wgsl(COLORED_MESH2D_SHADER, file!()),
);
// Register our custom draw function, and add our render systems
app.get_sub_app_mut(RenderApp)
.unwrap()
.add_render_command::<Transparent2d, DrawColoredMesh2d>()
.init_resource::<SpecializedRenderPipelines<ColoredMesh2dPipeline>>()
.init_resource::<RenderColoredMesh2dInstances>()
.add_systems(
ExtractSchedule,
extract_colored_mesh2d.after(extract_mesh2d),
)
.add_systems(Render, queue_colored_mesh2d.in_set(RenderSet::QueueMeshes));
}
sourcepub fn register_system<I, O, M, S>(&mut self, system: S) -> SystemId<I, O>where
I: 'static,
O: 'static,
S: IntoSystem<I, O, M> + 'static,
pub fn register_system<I, O, M, S>(&mut self, system: S) -> SystemId<I, O>where
I: 'static,
O: 'static,
S: IntoSystem<I, O, M> + 'static,
See App::register_system
.
sourcepub fn configure_sets(
&mut self,
schedule: impl ScheduleLabel,
sets: impl IntoSystemSetConfigs,
) -> &mut SubApp
pub fn configure_sets( &mut self, schedule: impl ScheduleLabel, sets: impl IntoSystemSetConfigs, ) -> &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,
Available on crate feature bevy_reflect
only.
pub fn register_type<T>(&mut self) -> &mut SubAppwhere
T: GetTypeRegistration,
bevy_reflect
only.See App::register_type
.
sourcepub fn register_type_data<T, D>(&mut self) -> &mut SubApp
Available on crate feature bevy_reflect
only.
pub fn register_type_data<T, D>(&mut self) -> &mut SubApp
bevy_reflect
only.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§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
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>
. 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<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
Self
using data from the given World
.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> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
source§fn null_value() -> T
fn null_value() -> T
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()
.