pub enum NextState<S>where
S: FreelyMutableState,{
Unchanged,
Pending(S),
PendingIfNeq(S),
}Expand description
The next state of State<S>.
This can be fetched as a resource and used to queue state transitions.
To queue a transition, call NextState::set or mutate the value to NextState::Pending directly.
Note that these transitions can be overridden by other systems:
only the actual value of this resource during the StateTransition schedule matters.
use bevy_state::prelude::*;
use bevy_ecs::prelude::*;
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, Default, States)]
enum GameState {
#[default]
MainMenu,
SettingsMenu,
InGame,
}
fn start_game(mut next_game_state: ResMut<NextState<GameState>>) {
next_game_state.set(GameState::InGame);
}Variants§
Unchanged
No state transition is pending
Pending(S)
There is a pending transition for state S
PendingIfNeq(S)
There is a pending transition for state S
This will not trigger state transitions schedules if the target state is the same as the current one.
Implementations§
Source§impl<S> NextState<S>where
S: FreelyMutableState,
impl<S> NextState<S>where
S: FreelyMutableState,
Sourcepub fn set(&mut self, state: S)
pub fn set(&mut self, state: S)
Tentatively set a pending state transition to Some(state).
This will run the state transition schedules OnEnter and OnExit.
If you want to skip those schedules for the same where we are transitioning to the same state, use set_if_neq instead.
Examples found in repository?
More examples
102 fn countdown(
103 mut game_state: ResMut<NextState<GameState>>,
104 time: Res<Time>,
105 mut timer: ResMut<SplashTimer>,
106 ) {
107 if timer.tick(time.delta()).is_finished() {
108 game_state.set(GameState::Menu);
109 }
110 }
111}
112
113mod game {
114 use bevy::{
115 color::palettes::basic::{BLUE, LIME},
116 prelude::*,
117 };
118
119 use super::{DisplayQuality, GameState, Volume, TEXT_COLOR};
120
121 // This plugin will contain the game. In this case, it's just be a screen that will
122 // display the current settings for 5 seconds before returning to the menu
123 pub fn game_plugin(app: &mut App) {
124 app.add_systems(OnEnter(GameState::Game), game_setup)
125 .add_systems(Update, game.run_if(in_state(GameState::Game)));
126 }
127
128 // Tag component used to tag entities added on the game screen
129 #[derive(Component)]
130 struct OnGameScreen;
131
132 #[derive(Resource, Deref, DerefMut)]
133 struct GameTimer(Timer);
134
135 fn game_setup(
136 mut commands: Commands,
137 display_quality: Res<DisplayQuality>,
138 volume: Res<Volume>,
139 ) {
140 commands.spawn((
141 DespawnOnExit(GameState::Game),
142 Node {
143 width: percent(100),
144 height: percent(100),
145 // center children
146 align_items: AlignItems::Center,
147 justify_content: JustifyContent::Center,
148 ..default()
149 },
150 OnGameScreen,
151 children![(
152 Node {
153 // This will display its children in a column, from top to bottom
154 flex_direction: FlexDirection::Column,
155 // `align_items` will align children on the cross axis. Here the main axis is
156 // vertical (column), so the cross axis is horizontal. This will center the
157 // children
158 align_items: AlignItems::Center,
159 ..default()
160 },
161 BackgroundColor(Color::BLACK),
162 children![
163 (
164 Text::new("Will be back to the menu shortly..."),
165 TextFont {
166 font_size: FontSize::Px(67.0),
167 ..default()
168 },
169 TextColor(TEXT_COLOR),
170 Node {
171 margin: UiRect::all(px(50)),
172 ..default()
173 },
174 ),
175 (
176 Text::default(),
177 Node {
178 margin: UiRect::all(px(50)),
179 ..default()
180 },
181 children![
182 (
183 TextSpan(format!("quality: {:?}", *display_quality)),
184 TextFont {
185 font_size: FontSize::Px(50.0),
186 ..default()
187 },
188 TextColor(BLUE.into()),
189 ),
190 (
191 TextSpan::new(" - "),
192 TextFont {
193 font_size: FontSize::Px(50.0),
194 ..default()
195 },
196 TextColor(TEXT_COLOR),
197 ),
198 (
199 TextSpan(format!("volume: {:?}", *volume)),
200 TextFont {
201 font_size: FontSize::Px(50.0),
202 ..default()
203 },
204 TextColor(LIME.into()),
205 ),
206 ]
207 ),
208 ]
209 )],
210 ));
211 // Spawn a 5 seconds timer to trigger going back to the menu
212 commands.insert_resource(GameTimer(Timer::from_seconds(5.0, TimerMode::Once)));
213 }
214
215 // Tick the timer, and change state when finished
216 fn game(
217 time: Res<Time>,
218 mut game_state: ResMut<NextState<GameState>>,
219 mut timer: ResMut<GameTimer>,
220 ) {
221 if timer.tick(time.delta()).is_finished() {
222 game_state.set(GameState::Menu);
223 }
224 }
225}
226
227mod menu {
228 use bevy::{
229 app::AppExit,
230 color::palettes::css::CRIMSON,
231 ecs::component::Mutable,
232 ecs::spawn::{SpawnIter, SpawnWith},
233 prelude::*,
234 };
235
236 use super::{DisplayQuality, GameState, Setting, Volume, TEXT_COLOR};
237
238 // This plugin manages the menu, with 5 different screens:
239 // - a main menu with "New Game", "Settings", "Quit"
240 // - a settings menu with two submenus and a back button
241 // - two settings screen with a setting that can be set and a back button
242 pub fn menu_plugin(app: &mut App) {
243 app
244 // At start, the menu is not enabled. This will be changed in `menu_setup` when
245 // entering the `GameState::Menu` state.
246 // Current screen in the menu is handled by an independent state from `GameState`
247 .init_state::<MenuState>()
248 .add_systems(OnEnter(GameState::Menu), menu_setup)
249 // Systems to handle the main menu screen
250 .add_systems(OnEnter(MenuState::Main), main_menu_setup)
251 // Systems to handle the settings menu screen
252 .add_systems(OnEnter(MenuState::Settings), settings_menu_setup)
253 // Systems to handle the display settings screen
254 .add_systems(
255 OnEnter(MenuState::SettingsDisplay),
256 display_settings_menu_setup,
257 )
258 .add_systems(
259 Update,
260 (setting_button::<DisplayQuality>.run_if(in_state(MenuState::SettingsDisplay)),),
261 )
262 // Systems to handle the sound settings screen
263 .add_systems(OnEnter(MenuState::SettingsSound), sound_settings_menu_setup)
264 .add_systems(
265 Update,
266 setting_button::<Volume>.run_if(in_state(MenuState::SettingsSound)),
267 )
268 // Common systems to all screens that handles buttons behavior
269 .add_systems(
270 Update,
271 (menu_action, button_system).run_if(in_state(GameState::Menu)),
272 );
273 }
274
275 // State used for the current menu screen
276 #[derive(Clone, Copy, Default, Eq, PartialEq, Debug, Hash, States)]
277 enum MenuState {
278 Main,
279 Settings,
280 SettingsDisplay,
281 SettingsSound,
282 #[default]
283 Disabled,
284 }
285
286 // Tag component used to tag entities added on the main menu screen
287 #[derive(Component)]
288 struct OnMainMenuScreen;
289
290 // Tag component used to tag entities added on the settings menu screen
291 #[derive(Component)]
292 struct OnSettingsMenuScreen;
293
294 // Tag component used to tag entities added on the display settings menu screen
295 #[derive(Component)]
296 struct OnDisplaySettingsMenuScreen;
297
298 // Tag component used to tag entities added on the sound settings menu screen
299 #[derive(Component)]
300 struct OnSoundSettingsMenuScreen;
301
302 const NORMAL_BUTTON: Color = Color::srgb(0.15, 0.15, 0.15);
303 const HOVERED_BUTTON: Color = Color::srgb(0.25, 0.25, 0.25);
304 const HOVERED_PRESSED_BUTTON: Color = Color::srgb(0.25, 0.65, 0.25);
305 const PRESSED_BUTTON: Color = Color::srgb(0.35, 0.75, 0.35);
306
307 // Tag component used to mark which setting is currently selected
308 #[derive(Component)]
309 struct SelectedOption;
310
311 // All actions that can be triggered from a button click
312 #[derive(Component)]
313 enum MenuButtonAction {
314 Play,
315 Settings,
316 SettingsDisplay,
317 SettingsSound,
318 BackToMainMenu,
319 BackToSettings,
320 Quit,
321 }
322
323 // This system handles changing all buttons color based on mouse interaction
324 fn button_system(
325 mut interaction_query: Query<
326 (&Interaction, &mut BackgroundColor, Option<&SelectedOption>),
327 (Changed<Interaction>, With<Button>),
328 >,
329 ) {
330 for (interaction, mut background_color, selected) in &mut interaction_query {
331 *background_color = match (*interaction, selected) {
332 (Interaction::Pressed, _) | (Interaction::None, Some(_)) => PRESSED_BUTTON.into(),
333 (Interaction::Hovered, Some(_)) => HOVERED_PRESSED_BUTTON.into(),
334 (Interaction::Hovered, None) => HOVERED_BUTTON.into(),
335 (Interaction::None, None) => NORMAL_BUTTON.into(),
336 }
337 }
338 }
339
340 // This system updates the settings when a new value for a setting is selected, and marks
341 // the button as the one currently selected
342 fn setting_button<T: Resource<Mutability = Mutable> + Component + PartialEq + Copy>(
343 interaction_query: Query<
344 (&Interaction, &Setting<T>, Entity),
345 (Changed<Interaction>, With<Button>),
346 >,
347 selected_query: Single<(Entity, &mut BackgroundColor), With<SelectedOption>>,
348 mut commands: Commands,
349 mut setting: ResMut<T>,
350 ) {
351 let (previous_button, mut previous_button_color) = selected_query.into_inner();
352 for (interaction, button_setting, entity) in &interaction_query {
353 if *interaction == Interaction::Pressed && *setting != button_setting.0 {
354 *previous_button_color = NORMAL_BUTTON.into();
355 commands.entity(previous_button).remove::<SelectedOption>();
356 commands.entity(entity).insert(SelectedOption);
357 *setting = button_setting.0;
358 }
359 }
360 }
361
362 fn menu_setup(mut menu_state: ResMut<NextState<MenuState>>) {
363 menu_state.set(MenuState::Main);
364 }
365
366 fn main_menu_setup(mut commands: Commands, asset_server: Res<AssetServer>) {
367 // Common style for all buttons on the screen
368 let button_node = Node {
369 width: px(300),
370 height: px(65),
371 margin: UiRect::all(px(20)),
372 justify_content: JustifyContent::Center,
373 align_items: AlignItems::Center,
374 ..default()
375 };
376 let button_icon_node = Node {
377 width: px(30),
378 // This takes the icons out of the flexbox flow, to be positioned exactly
379 position_type: PositionType::Absolute,
380 // The icon will be close to the left border of the button
381 left: px(10),
382 ..default()
383 };
384 let button_text_font = TextFont {
385 font_size: FontSize::Px(33.0),
386 ..default()
387 };
388
389 let right_icon = asset_server.load("textures/Game Icons/right.png");
390 let wrench_icon = asset_server.load("textures/Game Icons/wrench.png");
391 let exit_icon = asset_server.load("textures/Game Icons/exitRight.png");
392
393 commands.spawn((
394 DespawnOnExit(MenuState::Main),
395 Node {
396 width: percent(100),
397 height: percent(100),
398 align_items: AlignItems::Center,
399 justify_content: JustifyContent::Center,
400 ..default()
401 },
402 OnMainMenuScreen,
403 children![(
404 Node {
405 flex_direction: FlexDirection::Column,
406 align_items: AlignItems::Center,
407 ..default()
408 },
409 BackgroundColor(CRIMSON.into()),
410 children![
411 // Display the game name
412 (
413 Text::new("Bevy Game Menu UI"),
414 TextFont {
415 font_size: FontSize::Px(67.0),
416 ..default()
417 },
418 TextColor(TEXT_COLOR),
419 Node {
420 margin: UiRect::all(px(50)),
421 ..default()
422 },
423 ),
424 // Display three buttons for each action available from the main menu:
425 // - new game
426 // - settings
427 // - quit
428 (
429 Button,
430 button_node.clone(),
431 BackgroundColor(NORMAL_BUTTON),
432 MenuButtonAction::Play,
433 children![
434 (ImageNode::new(right_icon), button_icon_node.clone()),
435 (
436 Text::new("New Game"),
437 button_text_font.clone(),
438 TextColor(TEXT_COLOR),
439 ),
440 ]
441 ),
442 (
443 Button,
444 button_node.clone(),
445 BackgroundColor(NORMAL_BUTTON),
446 MenuButtonAction::Settings,
447 children![
448 (ImageNode::new(wrench_icon), button_icon_node.clone()),
449 (
450 Text::new("Settings"),
451 button_text_font.clone(),
452 TextColor(TEXT_COLOR),
453 ),
454 ]
455 ),
456 (
457 Button,
458 button_node,
459 BackgroundColor(NORMAL_BUTTON),
460 MenuButtonAction::Quit,
461 children![
462 (ImageNode::new(exit_icon), button_icon_node),
463 (Text::new("Quit"), button_text_font, TextColor(TEXT_COLOR),),
464 ]
465 ),
466 ]
467 )],
468 ));
469 }
470
471 fn settings_menu_setup(mut commands: Commands) {
472 let button_node = Node {
473 width: px(200),
474 height: px(65),
475 margin: UiRect::all(px(20)),
476 justify_content: JustifyContent::Center,
477 align_items: AlignItems::Center,
478 ..default()
479 };
480
481 let button_text_style = (
482 TextFont {
483 font_size: FontSize::Px(33.0),
484 ..default()
485 },
486 TextColor(TEXT_COLOR),
487 );
488
489 commands.spawn((
490 DespawnOnExit(MenuState::Settings),
491 Node {
492 width: percent(100),
493 height: percent(100),
494 align_items: AlignItems::Center,
495 justify_content: JustifyContent::Center,
496 ..default()
497 },
498 OnSettingsMenuScreen,
499 children![(
500 Node {
501 flex_direction: FlexDirection::Column,
502 align_items: AlignItems::Center,
503 ..default()
504 },
505 BackgroundColor(CRIMSON.into()),
506 Children::spawn(SpawnIter(
507 [
508 (MenuButtonAction::SettingsDisplay, "Display"),
509 (MenuButtonAction::SettingsSound, "Sound"),
510 (MenuButtonAction::BackToMainMenu, "Back"),
511 ]
512 .into_iter()
513 .map(move |(action, text)| {
514 (
515 Button,
516 button_node.clone(),
517 BackgroundColor(NORMAL_BUTTON),
518 action,
519 children![(Text::new(text), button_text_style.clone())],
520 )
521 })
522 ))
523 )],
524 ));
525 }
526
527 fn display_settings_menu_setup(mut commands: Commands, display_quality: Res<DisplayQuality>) {
528 fn button_node() -> Node {
529 Node {
530 width: px(200),
531 height: px(65),
532 margin: UiRect::all(px(20)),
533 justify_content: JustifyContent::Center,
534 align_items: AlignItems::Center,
535 ..default()
536 }
537 }
538 fn button_text_style() -> impl Bundle {
539 (
540 TextFont {
541 font_size: FontSize::Px(33.0),
542 ..default()
543 },
544 TextColor(TEXT_COLOR),
545 )
546 }
547
548 let display_quality = *display_quality;
549 commands.spawn((
550 DespawnOnExit(MenuState::SettingsDisplay),
551 Node {
552 width: percent(100),
553 height: percent(100),
554 align_items: AlignItems::Center,
555 justify_content: JustifyContent::Center,
556 ..default()
557 },
558 OnDisplaySettingsMenuScreen,
559 children![(
560 Node {
561 flex_direction: FlexDirection::Column,
562 align_items: AlignItems::Center,
563 ..default()
564 },
565 BackgroundColor(CRIMSON.into()),
566 children![
567 // Create a new `Node`, this time not setting its `flex_direction`. It will
568 // use the default value, `FlexDirection::Row`, from left to right.
569 (
570 Node {
571 align_items: AlignItems::Center,
572 ..default()
573 },
574 BackgroundColor(CRIMSON.into()),
575 Children::spawn((
576 // Display a label for the current setting
577 Spawn((Text::new("Display Quality"), button_text_style())),
578 SpawnWith(move |parent: &mut ChildSpawner| {
579 for quality_setting in [
580 DisplayQuality::Low,
581 DisplayQuality::Medium,
582 DisplayQuality::High,
583 ] {
584 let mut entity = parent.spawn((
585 Button,
586 Node {
587 width: px(150),
588 height: px(65),
589 ..button_node()
590 },
591 BackgroundColor(NORMAL_BUTTON),
592 Setting(quality_setting),
593 children![(
594 Text::new(format!("{quality_setting:?}")),
595 button_text_style(),
596 )],
597 ));
598 if display_quality == quality_setting {
599 entity.insert(SelectedOption);
600 }
601 }
602 })
603 ))
604 ),
605 // Display the back button to return to the settings screen
606 (
607 Button,
608 button_node(),
609 BackgroundColor(NORMAL_BUTTON),
610 MenuButtonAction::BackToSettings,
611 children![(Text::new("Back"), button_text_style())]
612 )
613 ]
614 )],
615 ));
616 }
617
618 fn sound_settings_menu_setup(mut commands: Commands, volume: Res<Volume>) {
619 let button_node = Node {
620 width: px(200),
621 height: px(65),
622 margin: UiRect::all(px(20)),
623 justify_content: JustifyContent::Center,
624 align_items: AlignItems::Center,
625 ..default()
626 };
627 let button_text_style = (
628 TextFont {
629 font_size: FontSize::Px(33.0),
630 ..default()
631 },
632 TextColor(TEXT_COLOR),
633 );
634
635 let volume = *volume;
636 let button_node_clone = button_node.clone();
637 commands.spawn((
638 DespawnOnExit(MenuState::SettingsSound),
639 Node {
640 width: percent(100),
641 height: percent(100),
642 align_items: AlignItems::Center,
643 justify_content: JustifyContent::Center,
644 ..default()
645 },
646 OnSoundSettingsMenuScreen,
647 children![(
648 Node {
649 flex_direction: FlexDirection::Column,
650 align_items: AlignItems::Center,
651 ..default()
652 },
653 BackgroundColor(CRIMSON.into()),
654 children![
655 (
656 Node {
657 align_items: AlignItems::Center,
658 ..default()
659 },
660 BackgroundColor(CRIMSON.into()),
661 Children::spawn((
662 Spawn((Text::new("Volume"), button_text_style.clone())),
663 SpawnWith(move |parent: &mut ChildSpawner| {
664 for volume_setting in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] {
665 let mut entity = parent.spawn((
666 Button,
667 Node {
668 width: px(30),
669 height: px(65),
670 ..button_node_clone.clone()
671 },
672 BackgroundColor(NORMAL_BUTTON),
673 Setting(Volume(volume_setting)),
674 ));
675 if volume == Volume(volume_setting) {
676 entity.insert(SelectedOption);
677 }
678 }
679 })
680 ))
681 ),
682 (
683 Button,
684 button_node,
685 BackgroundColor(NORMAL_BUTTON),
686 MenuButtonAction::BackToSettings,
687 children![(Text::new("Back"), button_text_style)]
688 )
689 ]
690 )],
691 ));
692 }
693
694 fn menu_action(
695 interaction_query: Query<
696 (&Interaction, &MenuButtonAction),
697 (Changed<Interaction>, With<Button>),
698 >,
699 mut app_exit_writer: MessageWriter<AppExit>,
700 mut menu_state: ResMut<NextState<MenuState>>,
701 mut game_state: ResMut<NextState<GameState>>,
702 ) {
703 for (interaction, menu_button_action) in &interaction_query {
704 if *interaction == Interaction::Pressed {
705 match menu_button_action {
706 MenuButtonAction::Quit => {
707 app_exit_writer.write(AppExit::Success);
708 }
709 MenuButtonAction::Play => {
710 game_state.set(GameState::Game);
711 menu_state.set(MenuState::Disabled);
712 }
713 MenuButtonAction::Settings => menu_state.set(MenuState::Settings),
714 MenuButtonAction::SettingsDisplay => {
715 menu_state.set(MenuState::SettingsDisplay);
716 }
717 MenuButtonAction::SettingsSound => {
718 menu_state.set(MenuState::SettingsSound);
719 }
720 MenuButtonAction::BackToMainMenu => menu_state.set(MenuState::Main),
721 MenuButtonAction::BackToSettings => {
722 menu_state.set(MenuState::Settings);
723 }
724 }
725 }
726 }
727 }357fn switch_cameras(current: Res<State<CameraActive>>, mut next: ResMut<NextState<CameraActive>>) {
358 let next_state = match current.get() {
359 CameraActive::Dim2 => CameraActive::Dim3,
360 CameraActive::Dim3 => CameraActive::Dim2,
361 };
362 next.set(next_state);
363}
364
365fn setup_text(mut commands: Commands, cameras: Query<(Entity, &Camera)>) {
366 let active_camera = cameras
367 .iter()
368 .find_map(|(entity, camera)| camera.is_active.then_some(entity))
369 .expect("run condition ensures existence");
370 commands.spawn((
371 HeaderNode,
372 Node {
373 justify_self: JustifySelf::Center,
374 top: px(5),
375 ..Default::default()
376 },
377 UiTargetCamera(active_camera),
378 children![(
379 Text::default(),
380 HeaderText,
381 TextLayout::justify(Justify::Center),
382 children![
383 TextSpan::new("Primitive: "),
384 TextSpan(format!("{text}", text = PrimitiveSelected::default())),
385 TextSpan::new("\n\n"),
386 TextSpan::new(
387 "Press 'C' to switch between 2D and 3D mode\n\
388 Press 'Up' or 'Down' to switch to the next/previous primitive",
389 ),
390 TextSpan::new("\n\n"),
391 TextSpan::new("(If nothing is displayed, there's no rendering support yet)",),
392 ]
393 )],
394 ));
395}
396
397fn update_text(
398 primitive_state: Res<State<PrimitiveSelected>>,
399 header: Query<Entity, With<HeaderText>>,
400 mut writer: TextUiWriter,
401) {
402 let new_text = format!("{text}", text = primitive_state.get());
403 header.iter().for_each(|header_text| {
404 if let Some(mut text) = writer.get_text(header_text, 2) {
405 (*text).clone_from(&new_text);
406 };
407 });
408}
409
410fn switch_to_next_primitive(
411 current: Res<State<PrimitiveSelected>>,
412 mut next: ResMut<NextState<PrimitiveSelected>>,
413) {
414 let next_state = current.get().next();
415 next.set(next_state);
416}
417
418fn switch_to_previous_primitive(
419 current: Res<State<PrimitiveSelected>>,
420 mut next: ResMut<NextState<PrimitiveSelected>>,
421) {
422 let next_state = current.get().previous();
423 next.set(next_state);
424}- examples/math/custom_primitives.rs
- examples/2d/texture_atlas.rs
- examples/math/bounding_2d.rs
- examples/asset/multi_asset_sync.rs
- examples/state/custom_transitions.rs
- examples/state/states.rs
- examples/state/sub_states.rs
- examples/testbed/helpers.rs
- examples/showcase/alien_cake_addict.rs
- examples/state/computed_states.rs
Sourcepub fn set_if_neq(&mut self, state: S)
pub fn set_if_neq(&mut self, state: S)
Trait Implementations§
Source§impl<S> Component for NextState<S>
impl<S> Component for NextState<S>
Source§const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::SparseSet
const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::SparseSet
Source§type Mutability = Mutable
type Mutability = Mutable
Component<Mutability = Mutable>,
while immutable components will instead have Component<Mutability = Immutable>. Read moreSource§fn register_required_components(
_requiree: ComponentId,
required_components: &mut RequiredComponentsRegistrator<'_, '_>,
)
fn register_required_components( _requiree: ComponentId, required_components: &mut RequiredComponentsRegistrator<'_, '_>, )
Source§fn clone_behavior() -> ComponentCloneBehavior
fn clone_behavior() -> ComponentCloneBehavior
Source§fn map_entities<M>(this: &mut NextState<S>, mapper: &mut M)where
M: EntityMapper,
fn map_entities<M>(this: &mut NextState<S>, mapper: &mut M)where
M: EntityMapper,
EntityMapper. This is used to remap entities in contexts like scenes and entity cloning.
When deriving Component, this is populated by annotating fields containing entities with #[entities] Read moreSource§fn relationship_accessor() -> Option<ComponentRelationshipAccessor<NextState<S>>>
fn relationship_accessor() -> Option<ComponentRelationshipAccessor<NextState<S>>>
ComponentRelationshipAccessor required for working with relationships in dynamic contexts. Read moreSource§fn on_add() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_add() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_insert() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_insert() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_remove() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_remove() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§impl<S> Default for NextState<S>where
S: FreelyMutableState,
impl<S> Default for NextState<S>where
S: FreelyMutableState,
Source§impl<S> Enum for NextState<S>where
S: FreelyMutableState + TypePath + FromReflect + MaybeTyped + RegisterForReflection,
NextState<S>: Any + Send + Sync,
impl<S> Enum for NextState<S>where
S: FreelyMutableState + TypePath + FromReflect + MaybeTyped + RegisterForReflection,
NextState<S>: Any + Send + Sync,
Source§fn field(&self, __name_param: &str) -> Option<&(dyn PartialReflect + 'static)>
fn field(&self, __name_param: &str) -> Option<&(dyn PartialReflect + 'static)>
Source§fn field_at(
&self,
__index_param: usize,
) -> Option<&(dyn PartialReflect + 'static)>
fn field_at( &self, __index_param: usize, ) -> Option<&(dyn PartialReflect + 'static)>
Source§fn field_mut(
&mut self,
__name_param: &str,
) -> Option<&mut (dyn PartialReflect + 'static)>
fn field_mut( &mut self, __name_param: &str, ) -> Option<&mut (dyn PartialReflect + 'static)>
Source§fn field_at_mut(
&mut self,
__index_param: usize,
) -> Option<&mut (dyn PartialReflect + 'static)>
fn field_at_mut( &mut self, __index_param: usize, ) -> Option<&mut (dyn PartialReflect + 'static)>
Source§fn index_of(&self, __name_param: &str) -> Option<usize>
fn index_of(&self, __name_param: &str) -> Option<usize>
Source§fn name_at(&self, __index_param: usize) -> Option<&str>
fn name_at(&self, __index_param: usize) -> Option<&str>
Source§fn iter_fields(&self) -> VariantFieldIter<'_> ⓘ
fn iter_fields(&self) -> VariantFieldIter<'_> ⓘ
Source§fn variant_name(&self) -> &str
fn variant_name(&self) -> &str
Source§fn variant_index(&self) -> usize
fn variant_index(&self) -> usize
Source§fn variant_type(&self) -> VariantType
fn variant_type(&self) -> VariantType
Source§fn to_dynamic_enum(&self) -> DynamicEnum
fn to_dynamic_enum(&self) -> DynamicEnum
DynamicEnum from this enum.Source§fn is_variant(&self, variant_type: VariantType) -> bool
fn is_variant(&self, variant_type: VariantType) -> bool
Source§fn variant_path(&self) -> String
fn variant_path(&self) -> String
Source§impl<S> FromArg for NextState<S>where
S: FreelyMutableState + TypePath + FromReflect + MaybeTyped + RegisterForReflection,
NextState<S>: Any + Send + Sync,
impl<S> FromArg for NextState<S>where
S: FreelyMutableState + TypePath + FromReflect + MaybeTyped + RegisterForReflection,
NextState<S>: Any + Send + Sync,
Source§impl<S> FromReflect for NextState<S>where
S: FreelyMutableState + TypePath + FromReflect + MaybeTyped + RegisterForReflection,
NextState<S>: Any + Send + Sync,
impl<S> FromReflect for NextState<S>where
S: FreelyMutableState + TypePath + FromReflect + MaybeTyped + RegisterForReflection,
NextState<S>: Any + Send + Sync,
Source§fn from_reflect(
__param0: &(dyn PartialReflect + 'static),
) -> Option<NextState<S>>
fn from_reflect( __param0: &(dyn PartialReflect + 'static), ) -> Option<NextState<S>>
Self from a reflected value.Source§fn take_from_reflect(
reflect: Box<dyn PartialReflect>,
) -> Result<Self, Box<dyn PartialReflect>>
fn take_from_reflect( reflect: Box<dyn PartialReflect>, ) -> Result<Self, Box<dyn PartialReflect>>
Self using,
constructing the value using from_reflect if that fails. Read moreSource§impl<S> GetOwnership for NextState<S>where
S: FreelyMutableState + TypePath + FromReflect + MaybeTyped + RegisterForReflection,
NextState<S>: Any + Send + Sync,
impl<S> GetOwnership for NextState<S>where
S: FreelyMutableState + TypePath + FromReflect + MaybeTyped + RegisterForReflection,
NextState<S>: Any + Send + Sync,
Source§impl<S> GetTypeRegistration for NextState<S>where
S: FreelyMutableState + TypePath + FromReflect + MaybeTyped + RegisterForReflection,
NextState<S>: Any + Send + Sync,
impl<S> GetTypeRegistration for NextState<S>where
S: FreelyMutableState + TypePath + FromReflect + MaybeTyped + RegisterForReflection,
NextState<S>: Any + Send + Sync,
Source§fn get_type_registration() -> TypeRegistration
fn get_type_registration() -> TypeRegistration
TypeRegistration for this type.Source§fn register_type_dependencies(registry: &mut TypeRegistry)
fn register_type_dependencies(registry: &mut TypeRegistry)
Source§impl<S> IntoReturn for NextState<S>where
S: FreelyMutableState + TypePath + FromReflect + MaybeTyped + RegisterForReflection,
NextState<S>: Any + Send + Sync,
impl<S> IntoReturn for NextState<S>where
S: FreelyMutableState + TypePath + FromReflect + MaybeTyped + RegisterForReflection,
NextState<S>: Any + Send + Sync,
Source§impl<S> PartialReflect for NextState<S>where
S: FreelyMutableState + TypePath + FromReflect + MaybeTyped + RegisterForReflection,
NextState<S>: Any + Send + Sync,
impl<S> PartialReflect for NextState<S>where
S: FreelyMutableState + TypePath + FromReflect + MaybeTyped + RegisterForReflection,
NextState<S>: Any + Send + Sync,
Source§fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
Source§fn try_apply(
&mut self,
__value_param: &(dyn PartialReflect + 'static),
) -> Result<(), ApplyError>
fn try_apply( &mut self, __value_param: &(dyn PartialReflect + 'static), ) -> Result<(), ApplyError>
Source§fn reflect_kind(&self) -> ReflectKind
fn reflect_kind(&self) -> ReflectKind
Source§fn reflect_ref(&self) -> ReflectRef<'_>
fn reflect_ref(&self) -> ReflectRef<'_>
Source§fn reflect_mut(&mut self) -> ReflectMut<'_>
fn reflect_mut(&mut self) -> ReflectMut<'_>
Source§fn reflect_owned(self: Box<NextState<S>>) -> ReflectOwned
fn reflect_owned(self: Box<NextState<S>>) -> ReflectOwned
Source§fn try_into_reflect(
self: Box<NextState<S>>,
) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>
fn try_into_reflect( self: Box<NextState<S>>, ) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>
Source§fn try_as_reflect(&self) -> Option<&(dyn Reflect + 'static)>
fn try_as_reflect(&self) -> Option<&(dyn Reflect + 'static)>
Source§fn try_as_reflect_mut(&mut self) -> Option<&mut (dyn Reflect + 'static)>
fn try_as_reflect_mut(&mut self) -> Option<&mut (dyn Reflect + 'static)>
Source§fn into_partial_reflect(self: Box<NextState<S>>) -> Box<dyn PartialReflect>
fn into_partial_reflect(self: Box<NextState<S>>) -> Box<dyn PartialReflect>
Source§fn as_partial_reflect(&self) -> &(dyn PartialReflect + 'static)
fn as_partial_reflect(&self) -> &(dyn PartialReflect + 'static)
Source§fn as_partial_reflect_mut(&mut self) -> &mut (dyn PartialReflect + 'static)
fn as_partial_reflect_mut(&mut self) -> &mut (dyn PartialReflect + 'static)
Source§fn reflect_hash(&self) -> Option<u64>
fn reflect_hash(&self) -> Option<u64>
Source§fn reflect_partial_eq(
&self,
value: &(dyn PartialReflect + 'static),
) -> Option<bool>
fn reflect_partial_eq( &self, value: &(dyn PartialReflect + 'static), ) -> Option<bool>
Source§fn reflect_partial_cmp(
&self,
value: &(dyn PartialReflect + 'static),
) -> Option<Ordering>
fn reflect_partial_cmp( &self, value: &(dyn PartialReflect + 'static), ) -> Option<Ordering>
Source§fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Source§fn reflect_clone(&self) -> Result<Box<dyn Reflect>, ReflectCloneError>
fn reflect_clone(&self) -> Result<Box<dyn Reflect>, ReflectCloneError>
Self using reflection. Read moreSource§fn apply(&mut self, value: &(dyn PartialReflect + 'static))
fn apply(&mut self, value: &(dyn PartialReflect + 'static))
Source§fn to_dynamic(&self) -> Box<dyn PartialReflect>
fn to_dynamic(&self) -> Box<dyn PartialReflect>
Source§fn reflect_clone_and_take<T>(&self) -> Result<T, ReflectCloneError>
fn reflect_clone_and_take<T>(&self) -> Result<T, ReflectCloneError>
PartialReflect, combines reflect_clone and
take in a useful fashion, automatically constructing an appropriate
ReflectCloneError if the downcast fails.Source§fn is_dynamic(&self) -> bool
fn is_dynamic(&self) -> bool
Source§impl<S> Reflect for NextState<S>where
S: FreelyMutableState + TypePath + FromReflect + MaybeTyped + RegisterForReflection,
NextState<S>: Any + Send + Sync,
impl<S> Reflect for NextState<S>where
S: FreelyMutableState + TypePath + FromReflect + MaybeTyped + RegisterForReflection,
NextState<S>: Any + Send + Sync,
Source§fn into_any(self: Box<NextState<S>>) -> Box<dyn Any>
fn into_any(self: Box<NextState<S>>) -> Box<dyn Any>
Box<dyn Any>. Read moreSource§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut dyn Any. Read moreSource§fn into_reflect(self: Box<NextState<S>>) -> Box<dyn Reflect>
fn into_reflect(self: Box<NextState<S>>) -> Box<dyn Reflect>
Source§fn as_reflect(&self) -> &(dyn Reflect + 'static)
fn as_reflect(&self) -> &(dyn Reflect + 'static)
Source§fn as_reflect_mut(&mut self) -> &mut (dyn Reflect + 'static)
fn as_reflect_mut(&mut self) -> &mut (dyn Reflect + 'static)
impl<S> Resource for NextState<S>
Source§impl<S> TypePath for NextState<S>
impl<S> TypePath for NextState<S>
Source§fn type_path() -> &'static str
fn type_path() -> &'static str
Source§fn short_type_path() -> &'static str
fn short_type_path() -> &'static str
Source§fn type_ident() -> Option<&'static str>
fn type_ident() -> Option<&'static str>
Source§fn crate_name() -> Option<&'static str>
fn crate_name() -> Option<&'static str>
Auto Trait Implementations§
impl<S> Freeze for NextState<S>where
S: Freeze,
impl<S> RefUnwindSafe for NextState<S>where
S: RefUnwindSafe,
impl<S> Send for NextState<S>
impl<S> Sync for NextState<S>
impl<S> Unpin for NextState<S>where
S: Unpin,
impl<S> UnsafeUnpin for NextState<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for NextState<S>where
S: UnwindSafe,
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<C> Bundle for Cwhere
C: Component,
impl<C> Bundle for Cwhere
C: Component,
fn component_ids( components: &mut ComponentsRegistrator<'_>, ) -> impl Iterator<Item = ComponentId> + use<C>
Source§fn get_component_ids(
components: &Components,
) -> impl Iterator<Item = Option<ComponentId>>
fn get_component_ids( components: &Components, ) -> impl Iterator<Item = Option<ComponentId>>
Source§impl<C> BundleFromComponents for Cwhere
C: Component,
impl<C> BundleFromComponents for Cwhere
C: Component,
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ConditionalSend for Twhere
T: Send,
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> DowncastSync for T
impl<T> DowncastSync for T
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<C> DynamicBundle for Cwhere
C: Component,
impl<C> DynamicBundle for Cwhere
C: Component,
Source§unsafe fn get_components(
ptr: MovingPtr<'_, C>,
func: &mut impl FnMut(StorageType, OwningPtr<'_>),
) -> <C as DynamicBundle>::Effect
unsafe fn get_components( ptr: MovingPtr<'_, C>, func: &mut impl FnMut(StorageType, OwningPtr<'_>), ) -> <C as DynamicBundle>::Effect
Source§unsafe fn apply_effect(
_ptr: MovingPtr<'_, MaybeUninit<C>>,
_entity: &mut EntityWorldMut<'_>,
)
unsafe fn apply_effect( _ptr: MovingPtr<'_, MaybeUninit<C>>, _entity: &mut EntityWorldMut<'_>, )
Source§impl<T> DynamicTypePath for Twhere
T: TypePath,
impl<T> DynamicTypePath for Twhere
T: TypePath,
Source§fn reflect_type_path(&self) -> &str
fn reflect_type_path(&self) -> &str
TypePath::type_path.Source§fn reflect_short_type_path(&self) -> &str
fn reflect_short_type_path(&self) -> &str
Source§fn reflect_type_ident(&self) -> Option<&str>
fn reflect_type_ident(&self) -> Option<&str>
TypePath::type_ident.Source§fn reflect_crate_name(&self) -> Option<&str>
fn reflect_crate_name(&self) -> Option<&str>
TypePath::crate_name.Source§fn reflect_module_path(&self) -> Option<&str>
fn reflect_module_path(&self) -> Option<&str>
Source§impl<T> DynamicTyped for Twhere
T: Typed,
impl<T> DynamicTyped for Twhere
T: Typed,
Source§fn reflect_type_info(&self) -> &'static TypeInfo
fn reflect_type_info(&self) -> &'static TypeInfo
Typed::type_info.Source§impl<T> ErasedBundleTemplate for T
impl<T> ErasedBundleTemplate for T
Source§unsafe fn apply(
&self,
context: &mut TemplateContext<'_, '_>,
) -> Result<(), BevyError>
unsafe fn apply( &self, context: &mut TemplateContext<'_, '_>, ) -> Result<(), BevyError>
entity. Read moreSource§fn clone_template(&self) -> Box<dyn ErasedBundleTemplate>
fn clone_template(&self) -> Box<dyn ErasedBundleTemplate>
Clone.impl<T> ErasedDestructor for Twhere
T: 'static,
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> FromTemplate for T
impl<T> FromTemplate for T
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> GetPath for T
impl<T> GetPath for T
Source§fn reflect_path<'p>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>>
fn reflect_path<'p>( &self, path: impl ReflectPath<'p>, ) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>>
path. Read moreSource§fn reflect_path_mut<'p>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut (dyn PartialReflect + 'static), ReflectPathError<'p>>
fn reflect_path_mut<'p>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut (dyn PartialReflect + 'static), ReflectPathError<'p>>
path. Read moreSource§fn path<'p, T>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&T, ReflectPathError<'p>>where
T: Reflect,
fn path<'p, T>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&T, ReflectPathError<'p>>where
T: Reflect,
path. Read moreSource§fn path_mut<'p, T>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut T, ReflectPathError<'p>>where
T: Reflect,
fn path_mut<'p, T>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut T, ReflectPathError<'p>>where
T: Reflect,
path. Read moreSource§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T> HitDataExtra for T
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
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<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Source§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<G> PatchFromTemplate for Gwhere
G: FromTemplate,
impl<G> PatchFromTemplate for Gwhere
G: FromTemplate,
Source§fn patch<F>(func: F) -> TemplatePatch<F, <G as PatchFromTemplate>::Template>
fn patch<F>(func: F) -> TemplatePatch<F, <G as PatchFromTemplate>::Template>
func, and turns it into a TemplatePatch.Source§impl<T> PatchTemplate for Twhere
T: Template,
impl<T> PatchTemplate for Twhere
T: Template,
Source§fn patch_template<F>(func: F) -> TemplatePatch<F, T>
fn patch_template<F>(func: F) -> TemplatePatch<F, 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.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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().impl<T> Reflectable for T
impl<T> Settings for T
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
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.Source§impl<T> Template for T
impl<T> Template for T
Source§fn build_template(
&self,
_context: &mut TemplateContext<'_, '_>,
) -> Result<<T as Template>::Output, BevyError>
fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>
entity context to produce a Template::Output.Source§fn clone_template(&self) -> T
fn clone_template(&self) -> T
Clone.