pub struct Time<T = ()>where
T: Default,{ /* private fields */ }Expand description
A generic clock resource that tracks how much it has advanced since its previous update and since its creation.
Multiple instances of this resource are inserted automatically by
TimePlugin:
Time<Real>tracks real wall-clock time elapsed.Time<Virtual>tracks virtual game time that may be paused or scaled.Time<Fixed>tracks fixed timesteps based on virtual time.Timeis a generic clock that corresponds to “current” or “default” time for systems. It containsTime<Virtual>except inside theFixedMainschedule when it containsTime<Fixed>.
The time elapsed since the previous time this clock was advanced is saved as
delta() and the total amount of time the clock has advanced
is saved as elapsed(). Both are represented as exact
Duration values with fixed nanosecond precision. The clock does not
support time moving backwards, but it can be updated with Duration::ZERO
which will set delta() to zero.
These values are also available in seconds as f32 via
delta_secs() and
elapsed_secs(), and also in seconds as f64
via delta_secs_f64() and
elapsed_secs_f64().
Since elapsed_secs() will grow constantly and
is f32, it will exhibit gradual precision loss. For applications that
require an f32 value but suffer from gradual precision loss there is
elapsed_secs_wrapped() available. The
same wrapped value is also available as Duration and f64 for
consistency. The wrap period is by default 1 hour, and can be set by
set_wrap_period().
§Accessing clocks
By default, any systems requiring current delta() or
elapsed() should use Res<Time> to access the default
time configured for the program. By default, this refers to
Time<Virtual> except during the
FixedMain schedule when it refers to
Time<Fixed>. This ensures your system can be used
either in Update or
FixedUpdate schedule depending on what is needed.
fn ambivalent_system(time: Res<Time>) {
println!("this how I see time: delta {:?}, elapsed {:?}", time.delta(), time.elapsed());
}If your system needs to react based on real time (wall clock time), like for
user interfaces, it should use Res<Time<Real>>. The
delta() and elapsed() values will always
correspond to real time and will not be affected by pause, time scaling or
other tweaks.
fn real_time_system(time: Res<Time<Real>>) {
println!("this will always be real time: delta {:?}, elapsed {:?}", time.delta(), time.elapsed());
}If your system specifically needs to access fixed timestep clock, even when
placed in Update schedule, you should use Res<Time<Fixed>>. The
delta() and elapsed() values will
correspond to the latest fixed timestep that has been run.
fn fixed_time_system(time: Res<Time<Fixed>>) {
println!("this will always be the last executed fixed timestep: delta {:?}, elapsed {:?}", time.delta(), time.elapsed());
}Finally, if your system specifically needs to know the current virtual game
time, even if placed inside FixedUpdate, for
example to know if the game is was_paused() or to use
effective_speed(), you can use
Res<Time<Virtual>>. However, if the system is placed in
FixedUpdate, extra care must be used because your
system might be run multiple times with the same delta()
and elapsed() values as the virtual game time has not
changed between the iterations.
fn fixed_time_system(time: Res<Time<Virtual>>) {
println!("this will be virtual time for this update: delta {:?}, elapsed {:?}", time.delta(), time.elapsed());
println!("also the relative speed of the game is now {}", time.effective_speed());
}If you need to change the settings for any of the clocks, for example to
pause() the game, you should use ResMut<Time<Virtual>>.
#[derive(Message)]
struct Pause(bool);
fn pause_system(mut time: ResMut<Time<Virtual>>, mut pause_reader: MessageReader<Pause>) {
for pause in pause_reader.read() {
if pause.0 {
time.pause();
} else {
time.unpause();
}
}
}§Adding custom clocks
New custom clocks can be created by creating your own struct as a context
and passing it to new_with(). These clocks can be
inserted as resources as normal and then accessed by systems. You can use
the advance_by() or advance_to()
methods to move the clock forwards based on your own logic.
If you want to add methods for your time instance and they require access to
both your context and the generic time part, it’s probably simplest to add a
custom trait for them and implement it for Time<Custom>.
Your context struct will need to implement the Default trait because
Time structures support reflection. It also makes initialization trivial
by being able to call app.init_resource::<Time<Custom>>().
You can also replace the “generic” Time clock resource if the “default”
time for your game should not be the default virtual time provided. You can
get a “generic” snapshot of your clock by calling as_generic() and then
overwrite the Time resource with it. The default systems added by
TimePlugin will overwrite the Time clock during
First and FixedUpdate
schedules.
#[derive(Debug)]
struct Custom {
last_external_time: Instant,
}
impl Default for Custom {
fn default() -> Self {
Self {
last_external_time: Instant::now(),
}
}
}
trait CustomTime {
fn update_from_external(&mut self, instant: Instant);
}
impl CustomTime for Time<Custom> {
fn update_from_external(&mut self, instant: Instant) {
let delta = instant - self.context().last_external_time;
self.advance_by(delta);
self.context_mut().last_external_time = instant;
}
}Implementations§
Source§impl Time<Fixed>
impl Time<Fixed>
Sourcepub fn from_duration(timestep: Duration) -> Time<Fixed>
pub fn from_duration(timestep: Duration) -> Time<Fixed>
Sourcepub fn from_seconds(seconds: f64) -> Time<Fixed>
pub fn from_seconds(seconds: f64) -> Time<Fixed>
Return new fixed time clock with given timestep seconds as f64
§Panics
Panics if seconds is zero, negative or not finite.
Sourcepub fn from_hz(hz: f64) -> Time<Fixed>
pub fn from_hz(hz: f64) -> Time<Fixed>
Return new fixed time clock with given timestep frequency in Hertz (1/seconds)
§Panics
Panics if hz is zero, negative or not finite.
Sourcepub fn timestep(&self) -> Duration
pub fn timestep(&self) -> Duration
Returns the amount of virtual time that must pass before the fixed timestep schedule is run again.
Sourcepub fn set_timestep(&mut self, timestep: Duration)
pub fn set_timestep(&mut self, timestep: Duration)
Sets the amount of virtual time that must pass before the fixed timestep
schedule is run again, as Duration.
Takes effect immediately on the next run of the schedule, respecting
what is currently in Self::overstep.
§Panics
Panics if timestep is zero.
Sourcepub fn set_timestep_seconds(&mut self, seconds: f64)
pub fn set_timestep_seconds(&mut self, seconds: f64)
Sets the amount of virtual time that must pass before the fixed timestep schedule is run again, as seconds.
Timestep is stored as a Duration, which has fixed nanosecond
resolution and will be converted from the floating point number.
Takes effect immediately on the next run of the schedule, respecting
what is currently in Self::overstep.
§Panics
Panics if seconds is zero, negative or not finite.
Sourcepub fn set_timestep_hz(&mut self, hz: f64)
pub fn set_timestep_hz(&mut self, hz: f64)
Sets the amount of virtual time that must pass before the fixed timestep schedule is run again, as frequency.
The timestep value is set to 1 / hz, converted to a Duration which
has fixed nanosecond resolution.
Takes effect immediately on the next run of the schedule, respecting
what is currently in Self::overstep.
§Panics
Panics if hz is zero, negative or not finite.
Sourcepub fn overstep(&self) -> Duration
pub fn overstep(&self) -> Duration
Returns the amount of overstep time accumulated toward new steps, as
Duration.
Sourcepub fn accumulate_overstep(&mut self, delta: Duration)
pub fn accumulate_overstep(&mut self, delta: Duration)
Increase the overstep time accumulated towards new steps.
This method is provided for use in tests. Ordinarily, the run_fixed_main_schedule system is responsible for calculating the overstep.
Sourcepub fn discard_overstep(&mut self, discard: Duration)
pub fn discard_overstep(&mut self, discard: Duration)
Discard a part of the overstep amount.
If discard is higher than overstep, the overstep becomes zero.
Sourcepub fn overstep_fraction(&self) -> f32
pub fn overstep_fraction(&self) -> f32
Returns the amount of overstep time accumulated toward new steps, as an
f32 fraction of the timestep.
Sourcepub fn overstep_fraction_f64(&self) -> f64
pub fn overstep_fraction_f64(&self) -> f64
Returns the amount of overstep time accumulated toward new steps, as an
f64 fraction of the timestep.
Source§impl Time<Real>
impl Time<Real>
Sourcepub fn new(startup: Instant) -> Time<Real>
pub fn new(startup: Instant) -> Time<Real>
Constructs a new Time<Real> instance with a specific startup
Instant.
Sourcepub fn update(&mut self)
pub fn update(&mut self)
Updates the internal time measurements.
Calling this method as part of your app will most likely result in
inaccurate timekeeping, as the Time resource is ordinarily managed
by the TimePlugin.
Sourcepub fn update_with_duration(&mut self, duration: Duration)
pub fn update_with_duration(&mut self, duration: Duration)
Updates time with a specified Duration.
This method is provided for use in tests.
Calling this method as part of your app will most likely result in
inaccurate timekeeping, as the Time resource is ordinarily managed
by the TimePlugin.
Sourcepub fn update_with_instant(&mut self, instant: Instant)
pub fn update_with_instant(&mut self, instant: Instant)
Updates time with a specified Instant.
This method is provided for use in tests.
Calling this method as part of your app will most likely result in inaccurate timekeeping,
as the Time resource is ordinarily managed by the TimePlugin.
Sourcepub fn startup(&self) -> Instant
pub fn startup(&self) -> Instant
Returns the Instant the clock was created.
This usually represents when the app was started.
Sourcepub fn first_update(&self) -> Option<Instant>
pub fn first_update(&self) -> Option<Instant>
Returns the Instant when Self::update was first called, if it
exists.
This usually represents when the first app update started.
Sourcepub fn last_update(&self) -> Option<Instant>
pub fn last_update(&self) -> Option<Instant>
Returns the Instant when Self::update was last called, if it
exists.
This usually represents when the current app update started.
Source§impl<T> Time<T>where
T: Default,
impl<T> Time<T>where
T: Default,
Sourcepub fn new_with(context: T) -> Time<T>
pub fn new_with(context: T) -> Time<T>
Create a new clock from context with Self::delta and Self::elapsed starting from
zero.
Sourcepub fn advance_by(&mut self, delta: Duration)
pub fn advance_by(&mut self, delta: Duration)
Advance this clock by adding a delta duration to it.
The added duration will be returned by Self::delta and
Self::elapsed will be increased by the duration. Adding
Duration::ZERO is allowed and will set Self::delta to zero.
Sourcepub fn advance_to(&mut self, elapsed: Duration)
pub fn advance_to(&mut self, elapsed: Duration)
Advance this clock to a specific elapsed time.
Self::delta() will return the amount of time the clock was advanced
and Self::elapsed() will be the elapsed value passed in. Cannot be
used to move time backwards.
§Panics
Panics if elapsed is less than Self::elapsed().
Sourcepub fn wrap_period(&self) -> Duration
pub fn wrap_period(&self) -> Duration
Returns the modulus used to calculate elapsed_wrapped.
Note: The default modulus is one hour.
Sourcepub fn set_wrap_period(&mut self, wrap_period: Duration)
pub fn set_wrap_period(&mut self, wrap_period: Duration)
Sets the modulus used to calculate elapsed_wrapped.
Note: This will not take effect until the next update.
§Panics
Panics if wrap_period is a zero-length duration.
Sourcepub fn delta(&self) -> Duration
pub fn delta(&self) -> Duration
Examples found in repository?
64fn text_update_system(
65 mut state: ResMut<State>,
66 time: Res<Time>,
67 mut query: Query<&mut Text>,
68 mut seeded_rng: ResMut<SeededRng>,
69) {
70 if !state.timer.tick(time.delta()).just_finished() {
71 return;
72 }
73
74 for mut text in &mut query {
75 let c = seeded_rng.random::<u8>() as char;
76 let string = &mut **text;
77 if !string.contains(c) {
78 string.push(c);
79 }
80 }
81}More examples
23fn animate_sprite(
24 time: Res<Time>,
25 mut query: Query<(&AnimationIndices, &mut AnimationTimer, &mut Sprite)>,
26) {
27 for (indices, mut timer, mut sprite) in &mut query {
28 timer.tick(time.delta());
29
30 if timer.just_finished()
31 && let Some(atlas) = &mut sprite.texture_atlas
32 {
33 atlas.index = if atlas.index == indices.last {
34 indices.first
35 } else {
36 atlas.index + 1
37 };
38 }
39 }
40}Sourcepub fn delta_secs(&self) -> f32
pub fn delta_secs(&self) -> f32
Examples found in repository?
More examples
47fn animate_materials(
48 material_handles: Query<&MeshMaterial3d<StandardMaterial>>,
49 time: Res<Time>,
50 mut materials: ResMut<Assets<StandardMaterial>>,
51) {
52 for material_handle in material_handles.iter() {
53 if let Some(material) = materials.get_mut(material_handle)
54 && let Color::Hsla(ref mut hsla) = material.base_color
55 {
56 *hsla = hsla.rotate_hue(time.delta_secs() * 100.0);
57 }
58 }
59}31fn sprite_movement(time: Res<Time>, mut sprite_position: Query<(&mut Direction, &mut Transform)>) {
32 for (mut logo, mut transform) in &mut sprite_position {
33 match *logo {
34 Direction::Right => transform.translation.x += 150. * time.delta_secs(),
35 Direction::Left => transform.translation.x -= 150. * time.delta_secs(),
36 }
37
38 if transform.translation.x > 200. {
39 *logo = Direction::Left;
40 } else if transform.translation.x < -200. {
41 *logo = Direction::Right;
42 }
43 }
44}72fn update_bloom_settings(
73 camera: Single<(Entity, &Tonemapping, Option<&mut Bloom>), With<Camera>>,
74 mut text: Single<&mut Text>,
75 mut commands: Commands,
76 keycode: Res<ButtonInput<KeyCode>>,
77 time: Res<Time>,
78) {
79 let (camera_entity, tonemapping, bloom) = camera.into_inner();
80
81 match bloom {
82 Some(mut bloom) => {
83 text.0 = "Bloom (Toggle: Space)\n".to_string();
84 text.push_str(&format!("(Q/A) Intensity: {:.2}\n", bloom.intensity));
85 text.push_str(&format!(
86 "(W/S) Low-frequency boost: {:.2}\n",
87 bloom.low_frequency_boost
88 ));
89 text.push_str(&format!(
90 "(E/D) Low-frequency boost curvature: {:.2}\n",
91 bloom.low_frequency_boost_curvature
92 ));
93 text.push_str(&format!(
94 "(R/F) High-pass frequency: {:.2}\n",
95 bloom.high_pass_frequency
96 ));
97 text.push_str(&format!(
98 "(T/G) Mode: {}\n",
99 match bloom.composite_mode {
100 BloomCompositeMode::EnergyConserving => "Energy-conserving",
101 BloomCompositeMode::Additive => "Additive",
102 }
103 ));
104 text.push_str(&format!(
105 "(Y/H) Threshold: {:.2}\n",
106 bloom.prefilter.threshold
107 ));
108 text.push_str(&format!(
109 "(U/J) Threshold softness: {:.2}\n",
110 bloom.prefilter.threshold_softness
111 ));
112 text.push_str(&format!("(I/K) Horizontal Scale: {:.2}\n", bloom.scale.x));
113
114 if keycode.just_pressed(KeyCode::Space) {
115 commands.entity(camera_entity).remove::<Bloom>();
116 }
117
118 let dt = time.delta_secs();
119
120 if keycode.pressed(KeyCode::KeyA) {
121 bloom.intensity -= dt / 10.0;
122 }
123 if keycode.pressed(KeyCode::KeyQ) {
124 bloom.intensity += dt / 10.0;
125 }
126 bloom.intensity = bloom.intensity.clamp(0.0, 1.0);
127
128 if keycode.pressed(KeyCode::KeyS) {
129 bloom.low_frequency_boost -= dt / 10.0;
130 }
131 if keycode.pressed(KeyCode::KeyW) {
132 bloom.low_frequency_boost += dt / 10.0;
133 }
134 bloom.low_frequency_boost = bloom.low_frequency_boost.clamp(0.0, 1.0);
135
136 if keycode.pressed(KeyCode::KeyD) {
137 bloom.low_frequency_boost_curvature -= dt / 10.0;
138 }
139 if keycode.pressed(KeyCode::KeyE) {
140 bloom.low_frequency_boost_curvature += dt / 10.0;
141 }
142 bloom.low_frequency_boost_curvature =
143 bloom.low_frequency_boost_curvature.clamp(0.0, 1.0);
144
145 if keycode.pressed(KeyCode::KeyF) {
146 bloom.high_pass_frequency -= dt / 10.0;
147 }
148 if keycode.pressed(KeyCode::KeyR) {
149 bloom.high_pass_frequency += dt / 10.0;
150 }
151 bloom.high_pass_frequency = bloom.high_pass_frequency.clamp(0.0, 1.0);
152
153 if keycode.pressed(KeyCode::KeyG) {
154 bloom.composite_mode = BloomCompositeMode::Additive;
155 }
156 if keycode.pressed(KeyCode::KeyT) {
157 bloom.composite_mode = BloomCompositeMode::EnergyConserving;
158 }
159
160 if keycode.pressed(KeyCode::KeyH) {
161 bloom.prefilter.threshold -= dt;
162 }
163 if keycode.pressed(KeyCode::KeyY) {
164 bloom.prefilter.threshold += dt;
165 }
166 bloom.prefilter.threshold = bloom.prefilter.threshold.max(0.0);
167
168 if keycode.pressed(KeyCode::KeyJ) {
169 bloom.prefilter.threshold_softness -= dt / 10.0;
170 }
171 if keycode.pressed(KeyCode::KeyU) {
172 bloom.prefilter.threshold_softness += dt / 10.0;
173 }
174 bloom.prefilter.threshold_softness = bloom.prefilter.threshold_softness.clamp(0.0, 1.0);
175
176 if keycode.pressed(KeyCode::KeyK) {
177 bloom.scale.x -= dt * 2.0;
178 }
179 if keycode.pressed(KeyCode::KeyI) {
180 bloom.scale.x += dt * 2.0;
181 }
182 bloom.scale.x = bloom.scale.x.clamp(0.0, 16.0);
183 }
184
185 None => {
186 text.0 = "Bloom: Off (Toggle: Space)\n".to_string();
187
188 if keycode.just_pressed(KeyCode::Space) {
189 commands.entity(camera_entity).insert(Bloom::default());
190 }
191 }
192 }
193
194 text.push_str(&format!("(O) Tonemapping: {tonemapping:?}\n"));
195 if keycode.just_pressed(KeyCode::KeyO) {
196 commands
197 .entity(camera_entity)
198 .insert(next_tonemap(tonemapping));
199 }
200}Sourcepub fn delta_secs_f64(&self) -> f64
pub fn delta_secs_f64(&self) -> f64
Sourcepub fn elapsed_secs(&self) -> f32
pub fn elapsed_secs(&self) -> f32
Returns how much time has advanced since startup, as f32 seconds.
Note: This is a monotonically increasing value. Its precision will degrade over time.
If you need an f32 but that precision loss is unacceptable,
use elapsed_secs_wrapped.
Examples found in repository?
More examples
51fn animate_light_direction(
52 time: Res<Time>,
53 mut query: Query<&mut Transform, With<DirectionalLight>>,
54) {
55 for mut transform in &mut query {
56 transform.rotation = Quat::from_euler(
57 EulerRot::ZYX,
58 0.0,
59 time.elapsed_secs() * PI / 5.0,
60 -FRAC_PI_4,
61 );
62 }
63}73fn update(
74 time: Res<Time>,
75 mut query: Query<(&MeshMaterial3d<CustomMaterial>, &mut Transform)>,
76 mut materials: ResMut<Assets<CustomMaterial>>,
77 keys: Res<ButtonInput<KeyCode>>,
78) {
79 for (material, mut transform) in query.iter_mut() {
80 let material = materials.get_mut(material).unwrap();
81 material.time.x = time.elapsed_secs();
82 if keys.just_pressed(KeyCode::Space) {
83 material.party_mode = !material.party_mode;
84 }
85
86 if material.party_mode {
87 transform.rotate(Quat::from_rotation_y(0.005));
88 }
89 }
90}57fn move_scene_entities(
58 time: Res<Time>,
59 moved_scene: Query<Entity, With<MovedScene>>,
60 children: Query<&Children>,
61 mut transforms: Query<&mut Transform>,
62) {
63 for moved_scene_entity in &moved_scene {
64 let mut offset = 0.;
65 for entity in children.iter_descendants(moved_scene_entity) {
66 if let Ok(mut transform) = transforms.get_mut(entity) {
67 transform.translation = Vec3::new(
68 offset * ops::sin(time.elapsed_secs()) / 20.,
69 0.,
70 ops::cos(time.elapsed_secs()) / 20.,
71 );
72 offset += 0.5;
73 }
74 }
75 }
76}68fn update(
69 time: Res<Time>,
70 material_handles: Res<CustomMaterialHandle>,
71 mut materials: ResMut<Assets<CustomMaterial>>,
72 mut buffers: ResMut<Assets<ShaderStorageBuffer>>,
73) {
74 let material = materials.get_mut(&material_handles.0).unwrap();
75
76 let buffer = buffers.get_mut(&material.colors).unwrap();
77 buffer.set_data(
78 (0..5)
79 .map(|i| {
80 let t = time.elapsed_secs() * 5.0;
81 [
82 ops::sin(t + i as f32) / 2.0 + 0.5,
83 ops::sin(t + i as f32 + 2.0) / 2.0 + 0.5,
84 ops::sin(t + i as f32 + 4.0) / 2.0 + 0.5,
85 1.0,
86 ]
87 })
88 .collect::<Vec<[f32; 4]>>(),
89 );
90}Sourcepub fn elapsed_secs_f64(&self) -> f64
pub fn elapsed_secs_f64(&self) -> f64
Sourcepub fn elapsed_wrapped(&self) -> Duration
pub fn elapsed_wrapped(&self) -> Duration
Returns how much time has advanced since startup modulo
the wrap_period, as Duration.
Sourcepub fn elapsed_secs_wrapped(&self) -> f32
pub fn elapsed_secs_wrapped(&self) -> f32
Returns how much time has advanced since startup modulo
the wrap_period, as f32 seconds.
This method is intended for applications (e.g. shaders) that require an f32 value but
suffer from the gradual precision loss of elapsed_secs.
Sourcepub fn elapsed_secs_wrapped_f64(&self) -> f64
pub fn elapsed_secs_wrapped_f64(&self) -> f64
Returns how much time has advanced since startup modulo
the wrap_period, as f64 seconds.
Sourcepub fn context_mut(&mut self) -> &mut T
pub fn context_mut(&mut self) -> &mut T
Returns a mutable reference to the context of this specific clock.
Sourcepub fn as_generic(&self) -> Time
pub fn as_generic(&self) -> Time
Returns a copy of this clock as fully generic clock without context.
Source§impl Time<Virtual>
impl Time<Virtual>
Sourcepub fn from_max_delta(max_delta: Duration) -> Time<Virtual>
pub fn from_max_delta(max_delta: Duration) -> Time<Virtual>
Sourcepub fn max_delta(&self) -> Duration
pub fn max_delta(&self) -> Duration
Returns the maximum amount of time that can be added to this clock by a
single update, as Duration.
This is the maximum value Self::delta() will return and also to
maximum time Self::elapsed() will be increased by in a single
update.
This ensures that even if no updates happen for an extended amount of time, the clock will not have a sudden, huge advance all at once. This also indirectly limits the maximum number of fixed update steps that can run in a single update.
The default value is 250 milliseconds.
Sourcepub fn set_max_delta(&mut self, max_delta: Duration)
pub fn set_max_delta(&mut self, max_delta: Duration)
Sets the maximum amount of time that can be added to this clock by a
single update, as Duration.
This is the maximum value Self::delta() will return and also to
maximum time Self::elapsed() will be increased by in a single
update.
This is used to ensure that even if the game freezes for a few seconds, or is suspended for hours or even days, the virtual clock doesn’t suddenly jump forward for that full amount, which would likely cause gameplay bugs or having to suddenly simulate all the intervening time.
If no updates happen for an extended amount of time, this limit prevents having a sudden, huge advance all at once. This also indirectly limits the maximum number of fixed update steps that can run in a single update.
The default value is 250 milliseconds. If you want to disable this
feature, set the value to Duration::MAX.
§Panics
Panics if max_delta is zero.
Sourcepub fn relative_speed(&self) -> f32
pub fn relative_speed(&self) -> f32
Returns the speed the clock advances relative to your system clock, as f32.
This is known as “time scaling” or “time dilation” in other engines.
Sourcepub fn relative_speed_f64(&self) -> f64
pub fn relative_speed_f64(&self) -> f64
Returns the speed the clock advances relative to your system clock, as f64.
This is known as “time scaling” or “time dilation” in other engines.
Sourcepub fn effective_speed(&self) -> f32
pub fn effective_speed(&self) -> f32
Returns the speed the clock advanced relative to your system clock in
this update, as f32.
Returns 0.0 if the game was paused or what the relative_speed value
was at the start of this update.
Sourcepub fn effective_speed_f64(&self) -> f64
pub fn effective_speed_f64(&self) -> f64
Returns the speed the clock advanced relative to your system clock in
this update, as f64.
Returns 0.0 if the game was paused or what the relative_speed value
was at the start of this update.
Sourcepub fn set_relative_speed(&mut self, ratio: f32)
pub fn set_relative_speed(&mut self, ratio: f32)
Sourcepub fn set_relative_speed_f64(&mut self, ratio: f64)
pub fn set_relative_speed_f64(&mut self, ratio: f64)
Sourcepub fn was_paused(&self) -> bool
pub fn was_paused(&self) -> bool
Returns true if the clock was paused at the start of this update.
Trait Implementations§
Source§impl<T> FromReflect for Time<T>
impl<T> FromReflect for Time<T>
Source§fn from_reflect(reflect: &(dyn PartialReflect + 'static)) -> Option<Time<T>>
fn from_reflect(reflect: &(dyn PartialReflect + 'static)) -> Option<Time<T>>
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<T> GetOwnership for Time<T>
impl<T> GetOwnership for Time<T>
Source§impl<T> GetTypeRegistration for Time<T>
impl<T> GetTypeRegistration for Time<T>
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<T> IntoReturn for Time<T>
impl<T> IntoReturn for Time<T>
Source§impl<T> PartialReflect for Time<T>
impl<T> PartialReflect for Time<T>
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: &(dyn PartialReflect + 'static),
) -> Result<(), ApplyError>
fn try_apply( &mut self, value: &(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<Time<T>>) -> ReflectOwned
fn reflect_owned(self: Box<Time<T>>) -> ReflectOwned
Source§fn try_into_reflect(
self: Box<Time<T>>,
) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>
fn try_into_reflect( self: Box<Time<T>>, ) -> 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<Time<T>>) -> Box<dyn PartialReflect>
fn into_partial_reflect(self: Box<Time<T>>) -> 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_partial_eq(
&self,
value: &(dyn PartialReflect + 'static),
) -> Option<bool>
fn reflect_partial_eq( &self, value: &(dyn PartialReflect + 'static), ) -> Option<bool>
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. Read moreSource§fn reflect_hash(&self) -> Option<u64>
fn reflect_hash(&self) -> Option<u64>
Source§fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Source§fn is_dynamic(&self) -> bool
fn is_dynamic(&self) -> bool
Source§impl<T> Reflect for Time<T>
impl<T> Reflect for Time<T>
Source§fn into_any(self: Box<Time<T>>) -> Box<dyn Any>
fn into_any(self: Box<Time<T>>) -> 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<Time<T>>) -> Box<dyn Reflect>
fn into_reflect(self: Box<Time<T>>) -> 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)
Source§impl<T> Struct for Time<T>
impl<T> Struct for Time<T>
Source§fn field(&self, name: &str) -> Option<&(dyn PartialReflect + 'static)>
fn field(&self, name: &str) -> Option<&(dyn PartialReflect + 'static)>
name as a &dyn PartialReflect.Source§fn field_mut(
&mut self,
name: &str,
) -> Option<&mut (dyn PartialReflect + 'static)>
fn field_mut( &mut self, name: &str, ) -> Option<&mut (dyn PartialReflect + 'static)>
name as a
&mut dyn PartialReflect.Source§fn field_at(&self, index: usize) -> Option<&(dyn PartialReflect + 'static)>
fn field_at(&self, index: usize) -> Option<&(dyn PartialReflect + 'static)>
index as a
&dyn PartialReflect.Source§fn field_at_mut(
&mut self,
index: usize,
) -> Option<&mut (dyn PartialReflect + 'static)>
fn field_at_mut( &mut self, index: usize, ) -> Option<&mut (dyn PartialReflect + 'static)>
index
as a &mut dyn PartialReflect.Source§fn name_at(&self, index: usize) -> Option<&str>
fn name_at(&self, index: usize) -> Option<&str>
index.Source§fn iter_fields(&self) -> FieldIter<'_> ⓘ
fn iter_fields(&self) -> FieldIter<'_> ⓘ
Source§fn to_dynamic_struct(&self) -> DynamicStruct
fn to_dynamic_struct(&self) -> DynamicStruct
DynamicStruct from this struct.Source§fn get_represented_struct_info(&self) -> Option<&'static StructInfo>
fn get_represented_struct_info(&self) -> Option<&'static StructInfo>
None if TypeInfo is not available.Source§impl<T> TypePath for Time<T>
impl<T> TypePath for Time<T>
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>
impl<T> Copy for Time<T>
impl<T> Resource for Time<T>
Auto Trait Implementations§
impl<T> Freeze for Time<T>where
T: Freeze,
impl<T> RefUnwindSafe for Time<T>where
T: RefUnwindSafe,
impl<T> Send for Time<T>where
T: Send,
impl<T> Sync for Time<T>where
T: Sync,
impl<T> Unpin for Time<T>where
T: Unpin,
impl<T> UnsafeUnpin for Time<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Time<T>where
T: 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<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>
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
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> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
Source§impl<S> GetField for Swhere
S: Struct,
impl<S> GetField for Swhere
S: Struct,
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,
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<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().Source§impl<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.