pub struct Timer { /* private fields */ }
Expand description
Tracks elapsed time. Enters the finished state once duration
is reached.
Non repeating timers will stop tracking and stay in the finished state until reset.
Repeating timers will only be in the finished state on each tick duration
is reached or
exceeded, and can still be reset at any given point.
Paused timers will not have elapsed time increased.
Note that in order to advance the timer tick
MUST be called.
Implementations§
Source§impl Timer
impl Timer
Sourcepub fn new(duration: Duration, mode: TimerMode) -> Self
pub fn new(duration: Duration, mode: TimerMode) -> Self
Creates a new timer with a given duration.
See also Timer::from_seconds
.
Sourcepub fn from_seconds(duration: f32, mode: TimerMode) -> Self
pub fn from_seconds(duration: f32, mode: TimerMode) -> Self
Creates a new timer with a given duration in seconds.
§Example
let mut timer = Timer::from_seconds(1.0, TimerMode::Once);
Sourcepub fn finished(&self) -> bool
pub fn finished(&self) -> bool
Returns true
if the timer has reached its duration.
For repeating timers, this method behaves identically to Timer::just_finished
.
§Examples
use std::time::Duration;
let mut timer_once = Timer::from_seconds(1.0, TimerMode::Once);
timer_once.tick(Duration::from_secs_f32(1.5));
assert!(timer_once.finished());
timer_once.tick(Duration::from_secs_f32(0.5));
assert!(timer_once.finished());
let mut timer_repeating = Timer::from_seconds(1.0, TimerMode::Repeating);
timer_repeating.tick(Duration::from_secs_f32(1.1));
assert!(timer_repeating.finished());
timer_repeating.tick(Duration::from_secs_f32(0.8));
assert!(!timer_repeating.finished());
timer_repeating.tick(Duration::from_secs_f32(0.6));
assert!(timer_repeating.finished());
Sourcepub fn just_finished(&self) -> bool
pub fn just_finished(&self) -> bool
Returns true
only on the tick the timer reached its duration.
§Examples
use std::time::Duration;
let mut timer = Timer::from_seconds(1.0, TimerMode::Once);
timer.tick(Duration::from_secs_f32(1.5));
assert!(timer.just_finished());
timer.tick(Duration::from_secs_f32(0.5));
assert!(!timer.just_finished());
Sourcepub fn elapsed(&self) -> Duration
pub fn elapsed(&self) -> Duration
Returns the time elapsed on the timer. Guaranteed to be between 0.0 and duration
.
Will only equal duration
when the timer is finished and non repeating.
See also Stopwatch::elapsed
.
§Examples
use std::time::Duration;
let mut timer = Timer::from_seconds(1.0, TimerMode::Once);
timer.tick(Duration::from_secs_f32(0.5));
assert_eq!(timer.elapsed(), Duration::from_secs_f32(0.5));
Sourcepub fn elapsed_secs(&self) -> f32
pub fn elapsed_secs(&self) -> f32
Returns the time elapsed on the timer as an f32
.
See also Timer::elapsed
.
Sourcepub fn elapsed_secs_f64(&self) -> f64
pub fn elapsed_secs_f64(&self) -> f64
Returns the time elapsed on the timer as an f64
.
See also Timer::elapsed
.
Sourcepub fn set_elapsed(&mut self, time: Duration)
pub fn set_elapsed(&mut self, time: Duration)
Sets the elapsed time of the timer without any other considerations.
See also Stopwatch::set
.
§
use std::time::Duration;
let mut timer = Timer::from_seconds(1.0, TimerMode::Once);
timer.set_elapsed(Duration::from_secs(2));
assert_eq!(timer.elapsed(), Duration::from_secs(2));
// the timer is not finished even if the elapsed time is greater than the duration.
assert!(!timer.finished());
Sourcepub fn duration(&self) -> Duration
pub fn duration(&self) -> Duration
Returns the duration of the timer.
§Examples
use std::time::Duration;
let timer = Timer::new(Duration::from_secs(1), TimerMode::Once);
assert_eq!(timer.duration(), Duration::from_secs(1));
Sourcepub fn set_duration(&mut self, duration: Duration)
pub fn set_duration(&mut self, duration: Duration)
Sets the duration of the timer.
§Examples
use std::time::Duration;
let mut timer = Timer::from_seconds(1.5, TimerMode::Once);
timer.set_duration(Duration::from_secs(1));
assert_eq!(timer.duration(), Duration::from_secs(1));
Sourcepub fn mode(&self) -> TimerMode
pub fn mode(&self) -> TimerMode
Returns the mode of the timer.
§Examples
let mut timer = Timer::from_seconds(1.0, TimerMode::Repeating);
assert_eq!(timer.mode(), TimerMode::Repeating);
Sourcepub fn set_mode(&mut self, mode: TimerMode)
pub fn set_mode(&mut self, mode: TimerMode)
Sets the mode of the timer.
§Examples
let mut timer = Timer::from_seconds(1.0, TimerMode::Repeating);
timer.set_mode(TimerMode::Once);
assert_eq!(timer.mode(), TimerMode::Once);
Sourcepub fn tick(&mut self, delta: Duration) -> &Self
pub fn tick(&mut self, delta: Duration) -> &Self
Advance the timer by delta
seconds.
Non repeating timer will clamp at duration.
Repeating timer will wrap around.
Will not affect paused timers.
See also Stopwatch::tick
.
§Examples
use std::time::Duration;
let mut timer = Timer::from_seconds(1.0, TimerMode::Once);
let mut repeating = Timer::from_seconds(1.0, TimerMode::Repeating);
timer.tick(Duration::from_secs_f32(1.5));
repeating.tick(Duration::from_secs_f32(1.5));
assert_eq!(timer.elapsed_secs(), 1.0);
assert_eq!(repeating.elapsed_secs(), 0.5);
Sourcepub fn pause(&mut self)
pub fn pause(&mut self)
Pauses the Timer. Disables the ticking of the timer.
See also Stopwatch::pause
.
§Examples
use std::time::Duration;
let mut timer = Timer::from_seconds(1.0, TimerMode::Once);
timer.pause();
timer.tick(Duration::from_secs_f32(0.5));
assert_eq!(timer.elapsed_secs(), 0.0);
Sourcepub fn unpause(&mut self)
pub fn unpause(&mut self)
Unpauses the Timer. Resumes the ticking of the timer.
See also Stopwatch::unpause()
.
§Examples
use std::time::Duration;
let mut timer = Timer::from_seconds(1.0, TimerMode::Once);
timer.pause();
timer.tick(Duration::from_secs_f32(0.5));
timer.unpause();
timer.tick(Duration::from_secs_f32(0.5));
assert_eq!(timer.elapsed_secs(), 0.5);
Sourcepub fn paused(&self) -> bool
pub fn paused(&self) -> bool
Returns true
if the timer is paused.
See also Stopwatch::is_paused
.
§Examples
let mut timer = Timer::from_seconds(1.0, TimerMode::Once);
assert!(!timer.paused());
timer.pause();
assert!(timer.paused());
timer.unpause();
assert!(!timer.paused());
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Resets the timer. The reset doesn’t affect the paused
state of the timer.
See also Stopwatch::reset
.
Examples
use std::time::Duration;
let mut timer = Timer::from_seconds(1.0, TimerMode::Once);
timer.tick(Duration::from_secs_f32(1.5));
timer.reset();
assert!(!timer.finished());
assert!(!timer.just_finished());
assert_eq!(timer.elapsed_secs(), 0.0);
Sourcepub fn fraction(&self) -> f32
pub fn fraction(&self) -> f32
Returns the fraction of the timer elapsed time (goes from 0.0 to 1.0).
§Examples
use std::time::Duration;
let mut timer = Timer::from_seconds(2.0, TimerMode::Once);
timer.tick(Duration::from_secs_f32(0.5));
assert_eq!(timer.fraction(), 0.25);
Sourcepub fn fraction_remaining(&self) -> f32
pub fn fraction_remaining(&self) -> f32
Returns the fraction of the timer remaining time (goes from 1.0 to 0.0).
§Examples
use std::time::Duration;
let mut timer = Timer::from_seconds(2.0, TimerMode::Once);
timer.tick(Duration::from_secs_f32(0.5));
assert_eq!(timer.fraction_remaining(), 0.75);
Sourcepub fn remaining_secs(&self) -> f32
pub fn remaining_secs(&self) -> f32
Returns the remaining time in seconds
§Examples
use std::cmp::Ordering;
use std::time::Duration;
let mut timer = Timer::from_seconds(2.0, TimerMode::Once);
timer.tick(Duration::from_secs_f32(0.5));
let result = timer.remaining_secs().total_cmp(&1.5);
assert_eq!(Ordering::Equal, result);
Sourcepub fn remaining(&self) -> Duration
pub fn remaining(&self) -> Duration
Returns the remaining time using Duration
§Examples
use std::time::Duration;
let mut timer = Timer::from_seconds(2.0, TimerMode::Once);
timer.tick(Duration::from_secs_f32(0.5));
assert_eq!(timer.remaining(), Duration::from_secs_f32(1.5));
Sourcepub fn times_finished_this_tick(&self) -> u32
pub fn times_finished_this_tick(&self) -> u32
Returns the number of times a repeating timer
finished during the last tick
call.
For non repeating-timers, this method will only ever return 0 or 1.
§Examples
use std::time::Duration;
let mut timer = Timer::from_seconds(1.0, TimerMode::Repeating);
timer.tick(Duration::from_secs_f32(6.0));
assert_eq!(timer.times_finished_this_tick(), 6);
timer.tick(Duration::from_secs_f32(2.0));
assert_eq!(timer.times_finished_this_tick(), 2);
timer.tick(Duration::from_secs_f32(0.5));
assert_eq!(timer.times_finished_this_tick(), 0);
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Timer
impl<'de> Deserialize<'de> for Timer
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl FromReflect for Timerwhere
Timer: Any + Send + Sync,
Stopwatch: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Duration: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
TimerMode: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
bool: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
u32: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl FromReflect for Timerwhere
Timer: Any + Send + Sync,
Stopwatch: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Duration: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
TimerMode: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
bool: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
u32: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Source§fn from_reflect(reflect: &dyn PartialReflect) -> Option<Self>
fn from_reflect(reflect: &dyn PartialReflect) -> Option<Self>
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 GetTypeRegistration for Timerwhere
Timer: Any + Send + Sync,
Stopwatch: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Duration: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
TimerMode: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
bool: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
u32: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl GetTypeRegistration for Timerwhere
Timer: Any + Send + Sync,
Stopwatch: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Duration: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
TimerMode: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
bool: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
u32: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
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 PartialReflect for Timerwhere
Timer: Any + Send + Sync,
Stopwatch: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Duration: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
TimerMode: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
bool: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
u32: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl PartialReflect for Timerwhere
Timer: Any + Send + Sync,
Stopwatch: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Duration: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
TimerMode: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
bool: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
u32: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Source§fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
Source§fn clone_value(&self) -> Box<dyn PartialReflect>
fn clone_value(&self) -> Box<dyn PartialReflect>
Reflect
trait object. Read moreSource§fn try_apply(&mut self, value: &dyn PartialReflect) -> Result<(), ApplyError>
fn try_apply(&mut self, value: &dyn PartialReflect) -> 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<Self>) -> ReflectOwned
fn reflect_owned(self: Box<Self>) -> ReflectOwned
Source§fn try_into_reflect(
self: Box<Self>,
) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>
fn try_into_reflect( self: Box<Self>, ) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>
Source§fn try_as_reflect(&self) -> Option<&dyn Reflect>
fn try_as_reflect(&self) -> Option<&dyn Reflect>
Source§fn try_as_reflect_mut(&mut self) -> Option<&mut dyn Reflect>
fn try_as_reflect_mut(&mut self) -> Option<&mut dyn Reflect>
Source§fn into_partial_reflect(self: Box<Self>) -> Box<dyn PartialReflect>
fn into_partial_reflect(self: Box<Self>) -> Box<dyn PartialReflect>
Source§fn as_partial_reflect(&self) -> &dyn PartialReflect
fn as_partial_reflect(&self) -> &dyn PartialReflect
Source§fn as_partial_reflect_mut(&mut self) -> &mut dyn PartialReflect
fn as_partial_reflect_mut(&mut self) -> &mut dyn PartialReflect
Source§fn reflect_partial_eq(&self, value: &dyn PartialReflect) -> Option<bool>
fn reflect_partial_eq(&self, value: &dyn PartialReflect) -> Option<bool>
Source§fn apply(&mut self, value: &(dyn PartialReflect + 'static))
fn apply(&mut self, value: &(dyn PartialReflect + 'static))
Source§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 serializable(&self) -> Option<Serializable<'_>>
fn serializable(&self) -> Option<Serializable<'_>>
Source§fn is_dynamic(&self) -> bool
fn is_dynamic(&self) -> bool
Source§impl Reflect for Timerwhere
Timer: Any + Send + Sync,
Stopwatch: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Duration: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
TimerMode: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
bool: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
u32: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl Reflect for Timerwhere
Timer: Any + Send + Sync,
Stopwatch: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Duration: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
TimerMode: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
bool: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
u32: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
&mut dyn Any
. Read moreSource§fn into_reflect(self: Box<Self>) -> Box<dyn Reflect>
fn into_reflect(self: Box<Self>) -> Box<dyn Reflect>
Source§fn as_reflect(&self) -> &dyn Reflect
fn as_reflect(&self) -> &dyn Reflect
Source§fn as_reflect_mut(&mut self) -> &mut dyn Reflect
fn as_reflect_mut(&mut self) -> &mut dyn Reflect
Source§impl Struct for Timerwhere
Timer: Any + Send + Sync,
Stopwatch: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Duration: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
TimerMode: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
bool: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
u32: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl Struct for Timerwhere
Timer: Any + Send + Sync,
Stopwatch: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Duration: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
TimerMode: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
bool: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
u32: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Source§fn field(&self, name: &str) -> Option<&dyn PartialReflect>
fn field(&self, name: &str) -> Option<&dyn PartialReflect>
name
as a &dyn PartialReflect
.Source§fn field_mut(&mut self, name: &str) -> Option<&mut dyn PartialReflect>
fn field_mut(&mut self, name: &str) -> Option<&mut dyn PartialReflect>
name
as a
&mut dyn PartialReflect
.Source§fn field_at(&self, index: usize) -> Option<&dyn PartialReflect>
fn field_at(&self, index: usize) -> Option<&dyn PartialReflect>
index
as a
&dyn PartialReflect
.Source§fn field_at_mut(&mut self, index: usize) -> Option<&mut dyn PartialReflect>
fn field_at_mut(&mut self, index: usize) -> Option<&mut dyn PartialReflect>
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 clone_dynamic(&self) -> DynamicStruct
fn clone_dynamic(&self) -> DynamicStruct
DynamicStruct
.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 TypePath for Timer
impl TypePath for Timer
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>
Source§impl Typed for Timerwhere
Timer: Any + Send + Sync,
Stopwatch: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Duration: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
TimerMode: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
bool: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
u32: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl Typed for Timerwhere
Timer: Any + Send + Sync,
Stopwatch: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Duration: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
TimerMode: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
bool: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
u32: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl Eq for Timer
impl StructuralPartialEq for Timer
Auto Trait Implementations§
impl Freeze for Timer
impl RefUnwindSafe for Timer
impl Send for Timer
impl Sync for Timer
impl Unpin for Timer
impl UnwindSafe for Timer
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> 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>
. 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> 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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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 more