Struct prodash::Throughput
source · 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 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