pub enum NextState<S>where
S: FreelyMutableState,{
Unchanged,
Pending(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§
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).
Examples found in repository?
More examples
examples/games/game_menu.rs (line 104)
98 fn countdown(
99 mut game_state: ResMut<NextState<GameState>>,
100 time: Res<Time>,
101 mut timer: ResMut<SplashTimer>,
102 ) {
103 if timer.tick(time.delta()).is_finished() {
104 game_state.set(GameState::Menu);
105 }
106 }
107}
108
109mod game {
110 use bevy::{
111 color::palettes::basic::{BLUE, LIME},
112 prelude::*,
113 };
114
115 use super::{DisplayQuality, GameState, Volume, TEXT_COLOR};
116
117 // This plugin will contain the game. In this case, it's just be a screen that will
118 // display the current settings for 5 seconds before returning to the menu
119 pub fn game_plugin(app: &mut App) {
120 app.add_systems(OnEnter(GameState::Game), game_setup)
121 .add_systems(Update, game.run_if(in_state(GameState::Game)));
122 }
123
124 // Tag component used to tag entities added on the game screen
125 #[derive(Component)]
126 struct OnGameScreen;
127
128 #[derive(Resource, Deref, DerefMut)]
129 struct GameTimer(Timer);
130
131 fn game_setup(
132 mut commands: Commands,
133 display_quality: Res<DisplayQuality>,
134 volume: Res<Volume>,
135 ) {
136 commands.spawn((
137 DespawnOnExit(GameState::Game),
138 Node {
139 width: percent(100),
140 height: percent(100),
141 // center children
142 align_items: AlignItems::Center,
143 justify_content: JustifyContent::Center,
144 ..default()
145 },
146 OnGameScreen,
147 children![(
148 Node {
149 // This will display its children in a column, from top to bottom
150 flex_direction: FlexDirection::Column,
151 // `align_items` will align children on the cross axis. Here the main axis is
152 // vertical (column), so the cross axis is horizontal. This will center the
153 // children
154 align_items: AlignItems::Center,
155 ..default()
156 },
157 BackgroundColor(Color::BLACK),
158 children![
159 (
160 Text::new("Will be back to the menu shortly..."),
161 TextFont {
162 font_size: 67.0,
163 ..default()
164 },
165 TextColor(TEXT_COLOR),
166 Node {
167 margin: UiRect::all(px(50)),
168 ..default()
169 },
170 ),
171 (
172 Text::default(),
173 Node {
174 margin: UiRect::all(px(50)),
175 ..default()
176 },
177 children![
178 (
179 TextSpan(format!("quality: {:?}", *display_quality)),
180 TextFont {
181 font_size: 50.0,
182 ..default()
183 },
184 TextColor(BLUE.into()),
185 ),
186 (
187 TextSpan::new(" - "),
188 TextFont {
189 font_size: 50.0,
190 ..default()
191 },
192 TextColor(TEXT_COLOR),
193 ),
194 (
195 TextSpan(format!("volume: {:?}", *volume)),
196 TextFont {
197 font_size: 50.0,
198 ..default()
199 },
200 TextColor(LIME.into()),
201 ),
202 ]
203 ),
204 ]
205 )],
206 ));
207 // Spawn a 5 seconds timer to trigger going back to the menu
208 commands.insert_resource(GameTimer(Timer::from_seconds(5.0, TimerMode::Once)));
209 }
210
211 // Tick the timer, and change state when finished
212 fn game(
213 time: Res<Time>,
214 mut game_state: ResMut<NextState<GameState>>,
215 mut timer: ResMut<GameTimer>,
216 ) {
217 if timer.tick(time.delta()).is_finished() {
218 game_state.set(GameState::Menu);
219 }
220 }
221}
222
223mod menu {
224 use bevy::{
225 app::AppExit,
226 color::palettes::css::CRIMSON,
227 ecs::spawn::{SpawnIter, SpawnWith},
228 prelude::*,
229 };
230
231 use super::{DisplayQuality, GameState, Volume, TEXT_COLOR};
232
233 // This plugin manages the menu, with 5 different screens:
234 // - a main menu with "New Game", "Settings", "Quit"
235 // - a settings menu with two submenus and a back button
236 // - two settings screen with a setting that can be set and a back button
237 pub fn menu_plugin(app: &mut App) {
238 app
239 // At start, the menu is not enabled. This will be changed in `menu_setup` when
240 // entering the `GameState::Menu` state.
241 // Current screen in the menu is handled by an independent state from `GameState`
242 .init_state::<MenuState>()
243 .add_systems(OnEnter(GameState::Menu), menu_setup)
244 // Systems to handle the main menu screen
245 .add_systems(OnEnter(MenuState::Main), main_menu_setup)
246 // Systems to handle the settings menu screen
247 .add_systems(OnEnter(MenuState::Settings), settings_menu_setup)
248 // Systems to handle the display settings screen
249 .add_systems(
250 OnEnter(MenuState::SettingsDisplay),
251 display_settings_menu_setup,
252 )
253 .add_systems(
254 Update,
255 (setting_button::<DisplayQuality>.run_if(in_state(MenuState::SettingsDisplay)),),
256 )
257 // Systems to handle the sound settings screen
258 .add_systems(OnEnter(MenuState::SettingsSound), sound_settings_menu_setup)
259 .add_systems(
260 Update,
261 setting_button::<Volume>.run_if(in_state(MenuState::SettingsSound)),
262 )
263 // Common systems to all screens that handles buttons behavior
264 .add_systems(
265 Update,
266 (menu_action, button_system).run_if(in_state(GameState::Menu)),
267 );
268 }
269
270 // State used for the current menu screen
271 #[derive(Clone, Copy, Default, Eq, PartialEq, Debug, Hash, States)]
272 enum MenuState {
273 Main,
274 Settings,
275 SettingsDisplay,
276 SettingsSound,
277 #[default]
278 Disabled,
279 }
280
281 // Tag component used to tag entities added on the main menu screen
282 #[derive(Component)]
283 struct OnMainMenuScreen;
284
285 // Tag component used to tag entities added on the settings menu screen
286 #[derive(Component)]
287 struct OnSettingsMenuScreen;
288
289 // Tag component used to tag entities added on the display settings menu screen
290 #[derive(Component)]
291 struct OnDisplaySettingsMenuScreen;
292
293 // Tag component used to tag entities added on the sound settings menu screen
294 #[derive(Component)]
295 struct OnSoundSettingsMenuScreen;
296
297 const NORMAL_BUTTON: Color = Color::srgb(0.15, 0.15, 0.15);
298 const HOVERED_BUTTON: Color = Color::srgb(0.25, 0.25, 0.25);
299 const HOVERED_PRESSED_BUTTON: Color = Color::srgb(0.25, 0.65, 0.25);
300 const PRESSED_BUTTON: Color = Color::srgb(0.35, 0.75, 0.35);
301
302 // Tag component used to mark which setting is currently selected
303 #[derive(Component)]
304 struct SelectedOption;
305
306 // All actions that can be triggered from a button click
307 #[derive(Component)]
308 enum MenuButtonAction {
309 Play,
310 Settings,
311 SettingsDisplay,
312 SettingsSound,
313 BackToMainMenu,
314 BackToSettings,
315 Quit,
316 }
317
318 // This system handles changing all buttons color based on mouse interaction
319 fn button_system(
320 mut interaction_query: Query<
321 (&Interaction, &mut BackgroundColor, Option<&SelectedOption>),
322 (Changed<Interaction>, With<Button>),
323 >,
324 ) {
325 for (interaction, mut background_color, selected) in &mut interaction_query {
326 *background_color = match (*interaction, selected) {
327 (Interaction::Pressed, _) | (Interaction::None, Some(_)) => PRESSED_BUTTON.into(),
328 (Interaction::Hovered, Some(_)) => HOVERED_PRESSED_BUTTON.into(),
329 (Interaction::Hovered, None) => HOVERED_BUTTON.into(),
330 (Interaction::None, None) => NORMAL_BUTTON.into(),
331 }
332 }
333 }
334
335 // This system updates the settings when a new value for a setting is selected, and marks
336 // the button as the one currently selected
337 fn setting_button<T: Resource + Component + PartialEq + Copy>(
338 interaction_query: Query<(&Interaction, &T, Entity), (Changed<Interaction>, With<Button>)>,
339 selected_query: Single<(Entity, &mut BackgroundColor), With<SelectedOption>>,
340 mut commands: Commands,
341 mut setting: ResMut<T>,
342 ) {
343 let (previous_button, mut previous_button_color) = selected_query.into_inner();
344 for (interaction, button_setting, entity) in &interaction_query {
345 if *interaction == Interaction::Pressed && *setting != *button_setting {
346 *previous_button_color = NORMAL_BUTTON.into();
347 commands.entity(previous_button).remove::<SelectedOption>();
348 commands.entity(entity).insert(SelectedOption);
349 *setting = *button_setting;
350 }
351 }
352 }
353
354 fn menu_setup(mut menu_state: ResMut<NextState<MenuState>>) {
355 menu_state.set(MenuState::Main);
356 }
357
358 fn main_menu_setup(mut commands: Commands, asset_server: Res<AssetServer>) {
359 // Common style for all buttons on the screen
360 let button_node = Node {
361 width: px(300),
362 height: px(65),
363 margin: UiRect::all(px(20)),
364 justify_content: JustifyContent::Center,
365 align_items: AlignItems::Center,
366 ..default()
367 };
368 let button_icon_node = Node {
369 width: px(30),
370 // This takes the icons out of the flexbox flow, to be positioned exactly
371 position_type: PositionType::Absolute,
372 // The icon will be close to the left border of the button
373 left: px(10),
374 ..default()
375 };
376 let button_text_font = TextFont {
377 font_size: 33.0,
378 ..default()
379 };
380
381 let right_icon = asset_server.load("textures/Game Icons/right.png");
382 let wrench_icon = asset_server.load("textures/Game Icons/wrench.png");
383 let exit_icon = asset_server.load("textures/Game Icons/exitRight.png");
384
385 commands.spawn((
386 DespawnOnExit(MenuState::Main),
387 Node {
388 width: percent(100),
389 height: percent(100),
390 align_items: AlignItems::Center,
391 justify_content: JustifyContent::Center,
392 ..default()
393 },
394 OnMainMenuScreen,
395 children![(
396 Node {
397 flex_direction: FlexDirection::Column,
398 align_items: AlignItems::Center,
399 ..default()
400 },
401 BackgroundColor(CRIMSON.into()),
402 children![
403 // Display the game name
404 (
405 Text::new("Bevy Game Menu UI"),
406 TextFont {
407 font_size: 67.0,
408 ..default()
409 },
410 TextColor(TEXT_COLOR),
411 Node {
412 margin: UiRect::all(px(50)),
413 ..default()
414 },
415 ),
416 // Display three buttons for each action available from the main menu:
417 // - new game
418 // - settings
419 // - quit
420 (
421 Button,
422 button_node.clone(),
423 BackgroundColor(NORMAL_BUTTON),
424 MenuButtonAction::Play,
425 children![
426 (ImageNode::new(right_icon), button_icon_node.clone()),
427 (
428 Text::new("New Game"),
429 button_text_font.clone(),
430 TextColor(TEXT_COLOR),
431 ),
432 ]
433 ),
434 (
435 Button,
436 button_node.clone(),
437 BackgroundColor(NORMAL_BUTTON),
438 MenuButtonAction::Settings,
439 children![
440 (ImageNode::new(wrench_icon), button_icon_node.clone()),
441 (
442 Text::new("Settings"),
443 button_text_font.clone(),
444 TextColor(TEXT_COLOR),
445 ),
446 ]
447 ),
448 (
449 Button,
450 button_node,
451 BackgroundColor(NORMAL_BUTTON),
452 MenuButtonAction::Quit,
453 children![
454 (ImageNode::new(exit_icon), button_icon_node),
455 (Text::new("Quit"), button_text_font, TextColor(TEXT_COLOR),),
456 ]
457 ),
458 ]
459 )],
460 ));
461 }
462
463 fn settings_menu_setup(mut commands: Commands) {
464 let button_node = Node {
465 width: px(200),
466 height: px(65),
467 margin: UiRect::all(px(20)),
468 justify_content: JustifyContent::Center,
469 align_items: AlignItems::Center,
470 ..default()
471 };
472
473 let button_text_style = (
474 TextFont {
475 font_size: 33.0,
476 ..default()
477 },
478 TextColor(TEXT_COLOR),
479 );
480
481 commands.spawn((
482 DespawnOnExit(MenuState::Settings),
483 Node {
484 width: percent(100),
485 height: percent(100),
486 align_items: AlignItems::Center,
487 justify_content: JustifyContent::Center,
488 ..default()
489 },
490 OnSettingsMenuScreen,
491 children![(
492 Node {
493 flex_direction: FlexDirection::Column,
494 align_items: AlignItems::Center,
495 ..default()
496 },
497 BackgroundColor(CRIMSON.into()),
498 Children::spawn(SpawnIter(
499 [
500 (MenuButtonAction::SettingsDisplay, "Display"),
501 (MenuButtonAction::SettingsSound, "Sound"),
502 (MenuButtonAction::BackToMainMenu, "Back"),
503 ]
504 .into_iter()
505 .map(move |(action, text)| {
506 (
507 Button,
508 button_node.clone(),
509 BackgroundColor(NORMAL_BUTTON),
510 action,
511 children![(Text::new(text), button_text_style.clone())],
512 )
513 })
514 ))
515 )],
516 ));
517 }
518
519 fn display_settings_menu_setup(mut commands: Commands, display_quality: Res<DisplayQuality>) {
520 fn button_node() -> Node {
521 Node {
522 width: px(200),
523 height: px(65),
524 margin: UiRect::all(px(20)),
525 justify_content: JustifyContent::Center,
526 align_items: AlignItems::Center,
527 ..default()
528 }
529 }
530 fn button_text_style() -> impl Bundle {
531 (
532 TextFont {
533 font_size: 33.0,
534 ..default()
535 },
536 TextColor(TEXT_COLOR),
537 )
538 }
539
540 let display_quality = *display_quality;
541 commands.spawn((
542 DespawnOnExit(MenuState::SettingsDisplay),
543 Node {
544 width: percent(100),
545 height: percent(100),
546 align_items: AlignItems::Center,
547 justify_content: JustifyContent::Center,
548 ..default()
549 },
550 OnDisplaySettingsMenuScreen,
551 children![(
552 Node {
553 flex_direction: FlexDirection::Column,
554 align_items: AlignItems::Center,
555 ..default()
556 },
557 BackgroundColor(CRIMSON.into()),
558 children![
559 // Create a new `Node`, this time not setting its `flex_direction`. It will
560 // use the default value, `FlexDirection::Row`, from left to right.
561 (
562 Node {
563 align_items: AlignItems::Center,
564 ..default()
565 },
566 BackgroundColor(CRIMSON.into()),
567 Children::spawn((
568 // Display a label for the current setting
569 Spawn((Text::new("Display Quality"), button_text_style())),
570 SpawnWith(move |parent: &mut ChildSpawner| {
571 for quality_setting in [
572 DisplayQuality::Low,
573 DisplayQuality::Medium,
574 DisplayQuality::High,
575 ] {
576 let mut entity = parent.spawn((
577 Button,
578 Node {
579 width: px(150),
580 height: px(65),
581 ..button_node()
582 },
583 BackgroundColor(NORMAL_BUTTON),
584 quality_setting,
585 children![(
586 Text::new(format!("{quality_setting:?}")),
587 button_text_style(),
588 )],
589 ));
590 if display_quality == quality_setting {
591 entity.insert(SelectedOption);
592 }
593 }
594 })
595 ))
596 ),
597 // Display the back button to return to the settings screen
598 (
599 Button,
600 button_node(),
601 BackgroundColor(NORMAL_BUTTON),
602 MenuButtonAction::BackToSettings,
603 children![(Text::new("Back"), button_text_style())]
604 )
605 ]
606 )],
607 ));
608 }
609
610 fn sound_settings_menu_setup(mut commands: Commands, volume: Res<Volume>) {
611 let button_node = Node {
612 width: px(200),
613 height: px(65),
614 margin: UiRect::all(px(20)),
615 justify_content: JustifyContent::Center,
616 align_items: AlignItems::Center,
617 ..default()
618 };
619 let button_text_style = (
620 TextFont {
621 font_size: 33.0,
622 ..default()
623 },
624 TextColor(TEXT_COLOR),
625 );
626
627 let volume = *volume;
628 let button_node_clone = button_node.clone();
629 commands.spawn((
630 DespawnOnExit(MenuState::SettingsSound),
631 Node {
632 width: percent(100),
633 height: percent(100),
634 align_items: AlignItems::Center,
635 justify_content: JustifyContent::Center,
636 ..default()
637 },
638 OnSoundSettingsMenuScreen,
639 children![(
640 Node {
641 flex_direction: FlexDirection::Column,
642 align_items: AlignItems::Center,
643 ..default()
644 },
645 BackgroundColor(CRIMSON.into()),
646 children![
647 (
648 Node {
649 align_items: AlignItems::Center,
650 ..default()
651 },
652 BackgroundColor(CRIMSON.into()),
653 Children::spawn((
654 Spawn((Text::new("Volume"), button_text_style.clone())),
655 SpawnWith(move |parent: &mut ChildSpawner| {
656 for volume_setting in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] {
657 let mut entity = parent.spawn((
658 Button,
659 Node {
660 width: px(30),
661 height: px(65),
662 ..button_node_clone.clone()
663 },
664 BackgroundColor(NORMAL_BUTTON),
665 Volume(volume_setting),
666 ));
667 if volume == Volume(volume_setting) {
668 entity.insert(SelectedOption);
669 }
670 }
671 })
672 ))
673 ),
674 (
675 Button,
676 button_node,
677 BackgroundColor(NORMAL_BUTTON),
678 MenuButtonAction::BackToSettings,
679 children![(Text::new("Back"), button_text_style)]
680 )
681 ]
682 )],
683 ));
684 }
685
686 fn menu_action(
687 interaction_query: Query<
688 (&Interaction, &MenuButtonAction),
689 (Changed<Interaction>, With<Button>),
690 >,
691 mut app_exit_writer: MessageWriter<AppExit>,
692 mut menu_state: ResMut<NextState<MenuState>>,
693 mut game_state: ResMut<NextState<GameState>>,
694 ) {
695 for (interaction, menu_button_action) in &interaction_query {
696 if *interaction == Interaction::Pressed {
697 match menu_button_action {
698 MenuButtonAction::Quit => {
699 app_exit_writer.write(AppExit::Success);
700 }
701 MenuButtonAction::Play => {
702 game_state.set(GameState::Game);
703 menu_state.set(MenuState::Disabled);
704 }
705 MenuButtonAction::Settings => menu_state.set(MenuState::Settings),
706 MenuButtonAction::SettingsDisplay => {
707 menu_state.set(MenuState::SettingsDisplay);
708 }
709 MenuButtonAction::SettingsSound => {
710 menu_state.set(MenuState::SettingsSound);
711 }
712 MenuButtonAction::BackToMainMenu => menu_state.set(MenuState::Main),
713 MenuButtonAction::BackToSettings => {
714 menu_state.set(MenuState::Settings);
715 }
716 }
717 }
718 }
719 }examples/math/render_primitives.rs (line 336)
331fn switch_cameras(current: Res<State<CameraActive>>, mut next: ResMut<NextState<CameraActive>>) {
332 let next_state = match current.get() {
333 CameraActive::Dim2 => CameraActive::Dim3,
334 CameraActive::Dim3 => CameraActive::Dim2,
335 };
336 next.set(next_state);
337}
338
339fn setup_text(mut commands: Commands, cameras: Query<(Entity, &Camera)>) {
340 let active_camera = cameras
341 .iter()
342 .find_map(|(entity, camera)| camera.is_active.then_some(entity))
343 .expect("run condition ensures existence");
344 commands.spawn((
345 HeaderNode,
346 Node {
347 justify_self: JustifySelf::Center,
348 top: px(5),
349 ..Default::default()
350 },
351 UiTargetCamera(active_camera),
352 children![(
353 Text::default(),
354 HeaderText,
355 TextLayout::new_with_justify(Justify::Center),
356 children![
357 TextSpan::new("Primitive: "),
358 TextSpan(format!("{text}", text = PrimitiveSelected::default())),
359 TextSpan::new("\n\n"),
360 TextSpan::new(
361 "Press 'C' to switch between 2D and 3D mode\n\
362 Press 'Up' or 'Down' to switch to the next/previous primitive",
363 ),
364 TextSpan::new("\n\n"),
365 TextSpan::new("(If nothing is displayed, there's no rendering support yet)",),
366 ]
367 )],
368 ));
369}
370
371fn update_text(
372 primitive_state: Res<State<PrimitiveSelected>>,
373 header: Query<Entity, With<HeaderText>>,
374 mut writer: TextUiWriter,
375) {
376 let new_text = format!("{text}", text = primitive_state.get());
377 header.iter().for_each(|header_text| {
378 if let Some(mut text) = writer.get_text(header_text, 2) {
379 (*text).clone_from(&new_text);
380 };
381 });
382}
383
384fn switch_to_next_primitive(
385 current: Res<State<PrimitiveSelected>>,
386 mut next: ResMut<NextState<PrimitiveSelected>>,
387) {
388 let next_state = current.get().next();
389 next.set(next_state);
390}
391
392fn switch_to_previous_primitive(
393 current: Res<State<PrimitiveSelected>>,
394 mut next: ResMut<NextState<PrimitiveSelected>>,
395) {
396 let next_state = current.get().previous();
397 next.set(next_state);
398}Additional examples can be found in:
- 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/games/alien_cake_addict.rs
- examples/state/computed_states.rs
Trait Implementations§
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)>
Returns a reference to the value of the field (in the current variant) with the given name. Read more
Source§fn field_at(
&self,
__index_param: usize,
) -> Option<&(dyn PartialReflect + 'static)>
fn field_at( &self, __index_param: usize, ) -> Option<&(dyn PartialReflect + 'static)>
Returns a reference to the value of the field (in the current variant) at the given index.
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)>
Returns a mutable reference to the value of the field (in the current variant) with the given name. Read more
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)>
Returns a mutable reference to the value of the field (in the current variant) at the given index.
Source§fn index_of(&self, __name_param: &str) -> Option<usize>
fn index_of(&self, __name_param: &str) -> Option<usize>
Returns the index of the field (in the current variant) with the given name. Read more
Source§fn name_at(&self, __index_param: usize) -> Option<&str>
fn name_at(&self, __index_param: usize) -> Option<&str>
Returns the name of the field (in the current variant) with the given index. Read more
Source§fn iter_fields(&self) -> VariantFieldIter<'_> ⓘ
fn iter_fields(&self) -> VariantFieldIter<'_> ⓘ
Returns an iterator over the values of the current variant’s fields.
Source§fn variant_name(&self) -> &str
fn variant_name(&self) -> &str
The name of the current variant.
Source§fn variant_index(&self) -> usize
fn variant_index(&self) -> usize
The index of the current variant.
Source§fn variant_type(&self) -> VariantType
fn variant_type(&self) -> VariantType
The type of the current variant.
Source§fn to_dynamic_enum(&self) -> DynamicEnum
fn to_dynamic_enum(&self) -> DynamicEnum
Creates a new
DynamicEnum from this enum.Source§fn is_variant(&self, variant_type: VariantType) -> bool
fn is_variant(&self, variant_type: VariantType) -> bool
Returns true if the current variant’s type matches the given one.
Source§fn variant_path(&self) -> String
fn variant_path(&self) -> String
Returns the full path to the current variant.
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>>
Constructs a concrete instance of
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>>
Attempts to downcast the given value to
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
Returns the default
TypeRegistration for this type.Source§fn register_type_dependencies(registry: &mut TypeRegistry)
fn register_type_dependencies(registry: &mut TypeRegistry)
Registers other types needed by this type. Read more
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
Returns a zero-sized enumeration of “kinds” of type. Read more
Source§fn reflect_ref(&self) -> ReflectRef<'_>
fn reflect_ref(&self) -> ReflectRef<'_>
Returns an immutable enumeration of “kinds” of type. Read more
Source§fn reflect_mut(&mut self) -> ReflectMut<'_>
fn reflect_mut(&mut self) -> ReflectMut<'_>
Returns a mutable enumeration of “kinds” of type. Read more
Source§fn reflect_owned(self: Box<NextState<S>>) -> ReflectOwned
fn reflect_owned(self: Box<NextState<S>>) -> ReflectOwned
Returns an owned enumeration of “kinds” of type. Read more
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>>
Attempts to cast this type to a boxed, fully-reflected value.
Source§fn try_as_reflect(&self) -> Option<&(dyn Reflect + 'static)>
fn try_as_reflect(&self) -> Option<&(dyn Reflect + 'static)>
Attempts to cast this type to a fully-reflected value.
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)>
Attempts to cast this type to a mutable, fully-reflected value.
Source§fn into_partial_reflect(self: Box<NextState<S>>) -> Box<dyn PartialReflect>
fn into_partial_reflect(self: Box<NextState<S>>) -> Box<dyn PartialReflect>
Casts this type to a boxed, reflected value. Read more
Source§fn as_partial_reflect(&self) -> &(dyn PartialReflect + 'static)
fn as_partial_reflect(&self) -> &(dyn PartialReflect + 'static)
Casts this type to a reflected value. Read more
Source§fn as_partial_reflect_mut(&mut self) -> &mut (dyn PartialReflect + 'static)
fn as_partial_reflect_mut(&mut self) -> &mut (dyn PartialReflect + 'static)
Casts this type to a mutable, reflected value. Read more
Source§fn reflect_hash(&self) -> Option<u64>
fn reflect_hash(&self) -> Option<u64>
Returns a hash of the value (which includes the type). Read more
Source§fn reflect_partial_eq(
&self,
value: &(dyn PartialReflect + 'static),
) -> Option<bool>
fn reflect_partial_eq( &self, value: &(dyn PartialReflect + 'static), ) -> Option<bool>
Returns a “partial equality” comparison result. Read more
Source§fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Debug formatter for the value. Read more
Source§fn reflect_clone(&self) -> Result<Box<dyn Reflect>, ReflectCloneError>
fn reflect_clone(&self) -> Result<Box<dyn Reflect>, ReflectCloneError>
Attempts to clone
Self using reflection. Read moreSource§fn apply(&mut self, value: &(dyn PartialReflect + 'static))
fn apply(&mut self, value: &(dyn PartialReflect + 'static))
Applies a reflected value to this value. Read more
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>
For a type implementing
PartialReflect, combines reflect_clone and
take in a useful fashion, automatically constructing an appropriate
ReflectCloneError if the downcast fails. Read moreSource§fn is_dynamic(&self) -> bool
fn is_dynamic(&self) -> bool
Indicates whether or not this type is a dynamic type. Read more
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>
Returns the value as a
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)
Returns the value as a
&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>
Casts this type to a boxed, fully-reflected value.
Source§fn as_reflect(&self) -> &(dyn Reflect + 'static)
fn as_reflect(&self) -> &(dyn Reflect + 'static)
Casts this type to a fully-reflected value.
Source§fn as_reflect_mut(&mut self) -> &mut (dyn Reflect + 'static)
fn as_reflect_mut(&mut self) -> &mut (dyn Reflect + 'static)
Casts this type to a mutable, fully-reflected value.
Source§impl<S> TypePath for NextState<S>
impl<S> TypePath for NextState<S>
Source§fn type_path() -> &'static str
fn type_path() -> &'static str
Returns the fully qualified path of the underlying type. Read more
Source§fn short_type_path() -> &'static str
fn short_type_path() -> &'static str
Returns a short, pretty-print enabled path to the type. Read more
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>
Source§impl<S> Typed for NextState<S>where
S: FreelyMutableState + TypePath + FromReflect + MaybeTyped + RegisterForReflection,
NextState<S>: Any + Send + Sync,
impl<S> Typed for NextState<S>where
S: FreelyMutableState + TypePath + FromReflect + MaybeTyped + RegisterForReflection,
NextState<S>: Any + Send + Sync,
impl<S> Resource for NextState<S>
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> 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
Return the
T ShaderType for self. When used in AsBindGroup
derives, it is safe to assume that all images in self exist.Source§impl<T> 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Downcast for 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>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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
See
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>
See
TypePath::type_ident.Source§fn reflect_crate_name(&self) -> Option<&str>
fn reflect_crate_name(&self) -> Option<&str>
See
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
See
Typed::type_info.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,
Causes
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,
Causes
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,
Causes
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,
Causes
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,
Causes
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,
Causes
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,
Causes
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,
Causes
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> 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>>
Returns a reference to the value specified by
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>>
Returns a mutable reference to the value specified by
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,
Returns a statically typed reference to the value specified by
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,
Returns a statically typed mutable reference to the value specified by
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,
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
Create an instance of this type from an initialization function
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> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read 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> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read 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>
Converts this type into the system output type.
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<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,
Pipes by value. This is generally the method you want to use. Read more
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
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,
Mutably borrows
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
Borrows
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
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>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().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
Convert from a type to another type.
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
Convert from a type to another type.
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
Immutable access to the
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
Mutable access to the
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
Immutable access to the
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
Mutable access to the
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
Immutable access to the
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
Mutable access to the
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
Calls
.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
Calls
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref() only in debug builds, and is erased in release
builds.Source§impl<T, U> ToSample<U> for Twhere
U: FromSample<T>,
impl<T, U> ToSample<U> for Twhere
U: FromSample<T>,
fn to_sample_(self) -> U
Source§impl<T> TypeData for T
impl<T> TypeData for T
Source§fn clone_type_data(&self) -> Box<dyn TypeData>
fn clone_type_data(&self) -> Box<dyn TypeData>
Creates a type-erased clone of this value.