pub struct Throughput { /* private fields */ }
Expand description
A utility to compute throughput of a set of progress values usually available to a renderer.
Implementations§
Source§impl Throughput
impl Throughput
Sourcepub fn update_elapsed(&mut self)
pub fn update_elapsed(&mut self)
Called at the beginning of the drawing of a renderer to remember at which time progress values are
going to be updated with update_and_get(…)
.
Sourcepub fn update_and_get(
&mut self,
key: &Key,
progress: Option<&Value>,
) -> Option<Throughput>
pub fn update_and_get( &mut self, key: &Key, progress: Option<&Value>, ) -> Option<Throughput>
Lookup or create the progress value at key
and set its current progress
, returning its computed
throughput.
Sourcepub fn reconcile(&mut self, sorted_values: &[(Key, Task)])
pub fn reconcile(&mut self, sorted_values: &[(Key, Task)])
Compare the keys in sorted_values
with our internal state and remove all missing tasks from it.
This should be called after update_and_get(…)
to pick up removed/finished
progress.
Trait Implementations§
Source§impl Default for Throughput
impl Default for Throughput
Source§fn default() -> Throughput
fn default() -> Throughput
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Throughput
impl RefUnwindSafe for Throughput
impl Send for Throughput
impl Sync for Throughput
impl Unpin for Throughput
impl UnwindSafe for Throughput
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
Mutably borrows from an owned value. Read more
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 more