Struct libhealth::plugins::steps::GraphModelSteps
source · pub struct GraphModelSteps { /* private fields */ }
Expand description
A GraphModelSteps manages step data for easy consumption in views.
Implementations§
source§impl GraphModelSteps
impl GraphModelSteps
pub fn new() -> Self
sourcepub fn today_step_count(&self) -> Option<u32>
pub fn today_step_count(&self) -> Option<u32>
Get how many steps have been done today.
Returns
The amount of steps that have been done today, none None
if no steps have been done yet.
sourcepub fn streak_count_today(&self, step_goal: u32) -> u32
pub fn streak_count_today(&self, step_goal: u32) -> u32
Get how many days the user has upheld their step streak (as in have reached their step goal), including today.
Returns
The number of days.
sourcepub fn streak_count_yesterday(&self, step_goal: u32) -> u32
pub fn streak_count_yesterday(&self, step_goal: u32) -> u32
Get how many days the user has upheld their step streak (as in have reached their step goal), excluding today.
Returns
The number of days.
Trait Implementations§
source§impl Debug for GraphModelSteps
impl Debug for GraphModelSteps
source§impl Default for GraphModelSteps
impl Default for GraphModelSteps
source§fn default() -> GraphModelSteps
fn default() -> GraphModelSteps
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for GraphModelSteps
impl !Send for GraphModelSteps
impl !Sync for GraphModelSteps
impl Unpin for GraphModelSteps
impl UnwindSafe for GraphModelSteps
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>where
F: FnOnce(&Self) -> bool,
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where F: FnOnce(&Self) -> bool,
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