pub struct SearchFoodResult {Show 13 fields
pub food_id: String,
pub name: String,
pub brand: Option<String>,
pub calories_per_100g: f64,
pub protein_per_100g: f64,
pub fat_per_100g: f64,
pub carbs_per_100g: f64,
pub default_serving: Option<FoodServing>,
pub servings: Vec<FoodServing>,
pub image_id: Option<String>,
pub nutrients_per_100g: HashMap<String, f64>,
pub source: Option<String>,
pub branded: bool,
}Expand description
A food search result from Typesense.
Fields§
§food_id: StringFood ID (e.g. “uc_5749” or “m_19306281”)
name: StringFood description/name
brand: Option<String>Brand name (None if generic/common food)
calories_per_100g: f64Calories per 100g
protein_per_100g: f64Protein per 100g
fat_per_100g: f64Fat per 100g
carbs_per_100g: f64Carbs per 100g
default_serving: Option<FoodServing>Default serving option
servings: Vec<FoodServing>All available serving options
image_id: Option<String>Image ID for the bundled SVG icon (maps to assets/foods/i{id}.svg in the app)
nutrients_per_100g: HashMap<String, f64>All nutrient values per 100g, keyed by USDA nutrient code (e.g. “269”=sugar, “291”=fiber)
source: Option<String>Data source (e.g. “USDAC”, “MND”)
branded: boolWhether this is a branded food (vs common)
Trait Implementations§
Source§impl Clone for SearchFoodResult
impl Clone for SearchFoodResult
Source§fn clone(&self) -> SearchFoodResult
fn clone(&self) -> SearchFoodResult
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 SearchFoodResult
impl Debug for SearchFoodResult
Source§impl<'de> Deserialize<'de> for SearchFoodResult
impl<'de> Deserialize<'de> for SearchFoodResult
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 SearchFoodResult
impl RefUnwindSafe for SearchFoodResult
impl Send for SearchFoodResult
impl Sync for SearchFoodResult
impl Unpin for SearchFoodResult
impl UnsafeUnpin for SearchFoodResult
impl UnwindSafe for SearchFoodResult
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