pub struct GoalProgress {
pub done: u32,
pub in_progress: u32,
pub total: u32,
}Expand description
Progress of a goal: how many children are done vs total.
A child is done when its state is 'done' or 'archived'.
In-progress children have state 'doing'. Open children are counted
in total but not in done or in_progress.
For nested goals, compute_nested_progress includes the leaf-item counts
across the entire subtree, rolling up through intermediate goal nodes.
Fields§
§done: u32Number of children (or leaf items in subtree) in the done/archived state.
in_progress: u32Number of children (or leaf items in subtree) in the doing state.
total: u32Total non-deleted children (or leaf items in subtree).
Implementations§
Source§impl GoalProgress
impl GoalProgress
Sourcepub fn percent_complete(&self) -> f32
pub fn percent_complete(&self) -> f32
Percentage of work completed, in the range 0.0..=100.0.
Returns 100.0 if total is 0 (vacuously complete).
Sourcepub const fn is_complete(&self) -> bool
pub const fn is_complete(&self) -> bool
Returns true if all children are done (or there are no children).
Trait Implementations§
Source§impl Clone for GoalProgress
impl Clone for GoalProgress
Source§fn clone(&self) -> GoalProgress
fn clone(&self) -> GoalProgress
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GoalProgress
impl Debug for GoalProgress
Source§impl Display for GoalProgress
impl Display for GoalProgress
Source§impl PartialEq for GoalProgress
impl PartialEq for GoalProgress
impl Eq for GoalProgress
impl StructuralPartialEq for GoalProgress
Auto Trait Implementations§
impl Freeze for GoalProgress
impl RefUnwindSafe for GoalProgress
impl Send for GoalProgress
impl Sync for GoalProgress
impl Unpin for GoalProgress
impl UnsafeUnpin for GoalProgress
impl UnwindSafe for GoalProgress
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Compare self to
key and return true if they are equal.