Struct iyes_progress::ProgressCounter
source · pub struct ProgressCounter { /* private fields */ }Expand description
Resource for tracking overall progress
This resource is automatically created when entering a state that was
configured using ProgressPlugin, and removed when exiting it.
Implementations
sourceimpl ProgressCounter
impl ProgressCounter
sourcepub fn progress(&self) -> Progress
pub fn progress(&self) -> Progress
Get the latest overall progress information
This is the combined total of all systems.
To get correct information, make sure that you call this function only after all your systems that track progress finished.
This does not include “hidden” progress. To get the full “real” total, use
progress_complete.
Use this method for progress bars and other things that indicate/report progress information to the user.
sourcepub fn progress_complete(&self) -> Progress
pub fn progress_complete(&self) -> Progress
Get the latest overall progress information
This is the combined total of all systems.
To get correct information, make sure that you call this function only after all your systems that track progress finished
This includes “hidden” progress. To get only the “visible” progress, use
progress.
This is the method to be used for things like state transitions, and other use cases that must account for the “true” actual progress of the registered systems.
sourcepub fn manually_track(&self, progress: Progress)
pub fn manually_track(&self, progress: Progress)
Add some amount of progress to the running total for the current frame.
In most cases you do not want to call this function yourself.
Let your systems return a Progress and wrap them in [track] instead.
Add some amount of “hidden” progress to the running total for the current frame.
Hidden progress counts towards the true total (like for triggering the
state transition) as reported by the progress_complete method, but is not
counted by the progress method. The intention is that it should not
affect things like progress bars and other user-facing indicators.
In most cases you do not want to call this function yourself.
Let your systems return a Progress and wrap them in [track] instead.
sourcepub fn persist_progress(&mut self, progress: Progress)
pub fn persist_progress(&mut self, progress: Progress)
Persist progress for the rest of the current state
Persist hidden progress for the rest of the current state
Trait Implementations
sourceimpl Default for ProgressCounter
impl Default for ProgressCounter
sourcefn default() -> ProgressCounter
fn default() -> ProgressCounter
impl Resource for ProgressCounterwhere
Self: Send + Sync + 'static,
Auto Trait Implementations
impl RefUnwindSafe for ProgressCounter
impl Send for ProgressCounter
impl Sync for ProgressCounter
impl Unpin for ProgressCounter
impl UnwindSafe for ProgressCounter
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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. Read morefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read morefn 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. Read morefn 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. Read moresourceimpl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
sourcefn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Self using data from the given World