pub enum Token<'a> {
Metadata {
key: &'a str,
value: &'a str,
},
Ingredient {
name: &'a str,
quantity: Option<&'a str>,
unit: Option<&'a str>,
},
RecipeRef {
name: &'a str,
quantity: Option<&'a str>,
unit: Option<&'a str>,
},
Timer(&'a str),
Material(&'a str),
Word(&'a str),
Space(&'a str),
Comment(&'a str),
Backstory(&'a str),
}Expand description
A recipe string is parsed into many of these tokens
Variants§
Metadata
Relevant information of a recipe that doesn’t make the recipe itself
Example:
>> name: SaladIngredient
Represents a recipe ingredient
Example
{tomato}(1 kg)RecipeRef
Link to another recipe
Example
@{path/recipe}(30 ml)Timer(&'a str)
Mark for a timer
Example
t{25 minutes}Material(&'a str)
Mark for a material required
Example
&{blender}Word(&'a str)
Space(&'a str)
Comment(&'a str)
Backstory(&'a str)
Information, story or notes about a recipe
Example
my recipe
---
shared by my best friendTrait Implementations§
impl<'a> Eq for Token<'a>
impl<'a> StructuralPartialEq for Token<'a>
Auto Trait Implementations§
impl<'a> Freeze for Token<'a>
impl<'a> RefUnwindSafe for Token<'a>
impl<'a> Send for Token<'a>
impl<'a> Sync for Token<'a>
impl<'a> Unpin for Token<'a>
impl<'a> UnwindSafe for Token<'a>
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