Struct libhealth::plugins::calories::GraphModelCaloriesMocked
source · pub struct GraphModelCaloriesMocked {
pub distinct_activities: Vec<ActivityType>,
pub rmr: f32,
}
Expand description
A GraphModelCaloriesMocked manages calories data for easy consumption in views.
Fields§
§distinct_activities: Vec<ActivityType>
§rmr: f32
Implementations§
source§impl GraphModelCaloriesMocked
impl GraphModelCaloriesMocked
pub fn new() -> Self
pub async fn reload(&mut self, _duration: TimeSpan) -> Result<()>
sourcepub fn to_split_bar(&self) -> Vec<SplitBar>
pub fn to_split_bar(&self) -> Vec<SplitBar>
Converts the model’s data to an array of SplitBars
so it can be displayed in a BarGraphView
.
pub fn distinct_activities(&self) -> &[ActivityType]
pub async fn rmr(&self) -> f32
pub fn is_empty(&self) -> bool
Trait Implementations§
source§impl Debug for GraphModelCaloriesMocked
impl Debug for GraphModelCaloriesMocked
source§impl Default for GraphModelCaloriesMocked
impl Default for GraphModelCaloriesMocked
source§fn default() -> GraphModelCaloriesMocked
fn default() -> GraphModelCaloriesMocked
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for GraphModelCaloriesMocked
impl Send for GraphModelCaloriesMocked
impl Sync for GraphModelCaloriesMocked
impl Unpin for GraphModelCaloriesMocked
impl UnwindSafe for GraphModelCaloriesMocked
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