pub struct FixedTimesteps { /* private fields */ }Expand description
Resource type that allows you to get info about and to manipulate fixed timestep state
If you want to access parameters of your fixed timestep(s), such as the timestep duration,
accumulator, and paused state, you can get them from this resource. They are contained
in a FixedTimestepInfo struct, which you can get using the various methods on this type.
If you mutate the timestep duration or paused state, they will be taken into account from the next run of that fixed timestep.
From within a fixed timestep system, you can also mutate the accumulator. May be useful for networking or other use cases that need to stretch time.
Implementations§
Source§impl FixedTimesteps
impl FixedTimesteps
Sourcepub fn get(&self, label: TimestepName) -> Option<&FixedTimestepInfo>
pub fn get(&self, label: TimestepName) -> Option<&FixedTimestepInfo>
Returns a reference to the timestep info for a given timestep by name.
Sourcepub fn get_current(&self) -> Option<&FixedTimestepInfo>
pub fn get_current(&self) -> Option<&FixedTimestepInfo>
Returns a reference to the timestep info for the currently running stage.
Returns Some only if called inside a fixed timestep stage.
Sourcepub fn current(&self) -> &FixedTimestepInfo
pub fn current(&self) -> &FixedTimestepInfo
Panicking version of [get_current]
Sourcepub fn get_single(&self) -> Option<&FixedTimestepInfo>
pub fn get_single(&self) -> Option<&FixedTimestepInfo>
Returns a reference to the timestep info, assuming you only have one.
Sourcepub fn single(&self) -> &FixedTimestepInfo
pub fn single(&self) -> &FixedTimestepInfo
Panicking version of [get_single]
Sourcepub fn get_mut(&mut self, label: TimestepName) -> Option<&mut FixedTimestepInfo>
pub fn get_mut(&mut self, label: TimestepName) -> Option<&mut FixedTimestepInfo>
Returns a mut reference to the timestep info for a given timestep by name.
Sourcepub fn get_current_mut(&mut self) -> Option<&mut FixedTimestepInfo>
pub fn get_current_mut(&mut self) -> Option<&mut FixedTimestepInfo>
Returns a mut reference to the timestep info for the currently running stage.
Returns Some only if called inside a fixed timestep stage.
Sourcepub fn current_mut(&mut self) -> &mut FixedTimestepInfo
pub fn current_mut(&mut self) -> &mut FixedTimestepInfo
Panicking version of [get_current_mut]
Sourcepub fn get_single_mut(&mut self) -> Option<&mut FixedTimestepInfo>
pub fn get_single_mut(&mut self) -> Option<&mut FixedTimestepInfo>
Returns a mut reference to the timestep info, assuming you only have one.
Sourcepub fn single_mut(&mut self) -> &mut FixedTimestepInfo
pub fn single_mut(&mut self) -> &mut FixedTimestepInfo
Panicking version of [get_single_mut]
Trait Implementations§
Source§impl Default for FixedTimesteps
impl Default for FixedTimesteps
Source§fn default() -> FixedTimesteps
fn default() -> FixedTimesteps
impl Resource for FixedTimesteps
Auto Trait Implementations§
impl Freeze for FixedTimesteps
impl RefUnwindSafe for FixedTimesteps
impl Send for FixedTimesteps
impl Sync for FixedTimesteps
impl Unpin for FixedTimesteps
impl UnsafeUnpin for FixedTimesteps
impl UnwindSafe for FixedTimesteps
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync 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
Self using data from the given World