pub struct FoodEntry {Show 17 fields
pub date: NaiveDate,
pub entry_id: String,
pub name: Option<String>,
pub brand: Option<String>,
pub calories_raw: Option<f64>,
pub protein_raw: Option<f64>,
pub carbs_raw: Option<f64>,
pub fat_raw: Option<f64>,
pub serving_grams: Option<f64>,
pub user_qty: Option<f64>,
pub unit_weight: Option<f64>,
pub quantity: Option<f64>,
pub serving_unit: Option<String>,
pub hour: Option<String>,
pub minute: Option<String>,
pub source_type: Option<String>,
pub food_id: Option<String>,
}Expand description
An individual food log entry.
Raw values (calories_raw, protein_raw, etc.) are per serving size (serving_grams).
Use the accessor methods (.calories(), .protein(), etc.) to get actual consumed amounts,
which apply the quantity multiplier: raw * (user_qty * unit_weight) / serving_grams.
Fields§
§date: NaiveDate§entry_id: StringEntry timestamp ID
name: Option<String>Food name
brand: Option<String>Brand
calories_raw: Option<f64>Calories per serving size (kcal)
protein_raw: Option<f64>Protein per serving size (g)
carbs_raw: Option<f64>Carbs per serving size (g)
fat_raw: Option<f64>Fat per serving size (g)
serving_grams: Option<f64>Grams per serving size (“g” field)
user_qty: Option<f64>User quantity in display units (“y” field)
unit_weight: Option<f64>Grams per display unit (“w” field)
quantity: Option<f64>Quantity in serving units (“q” field)
serving_unit: Option<String>Serving unit
hour: Option<String>Hour logged
minute: Option<String>Minute logged
source_type: Option<String>Source type: “t” = typesense, “n” = custom
food_id: Option<String>Food ID
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FoodEntry
impl<'de> Deserialize<'de> for FoodEntry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FoodEntry
impl RefUnwindSafe for FoodEntry
impl Send for FoodEntry
impl Sync for FoodEntry
impl Unpin for FoodEntry
impl UnsafeUnpin for FoodEntry
impl UnwindSafe for FoodEntry
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