preps future ideas

This commit is contained in:
artus
2019-01-05 21:56:17 +01:00
parent 8699dfef33
commit 5233e44bf4
3 changed files with 34 additions and 0 deletions

View File

@@ -1,4 +1,6 @@
mod meal; mod meal;
mod storage;
mod importer;
pub use self::meal::Meal; pub use self::meal::Meal;

View File

@@ -1,5 +1,17 @@
/// An individual ingredient
pub struct Ingredient {
name: String,
}
impl Ingredient {
pub(super) fn new(name: String) -> Ingredient {
Ingredient { name }
}
}
/// An ordered set of dishes
#[derive(Debug,Clone)] #[derive(Debug,Clone)]
pub struct Meal { pub struct Meal {
name: String, name: String,

20
cookbook/src/storage.rs Normal file
View File

@@ -0,0 +1,20 @@
//! Storage backend for persistent data
//!
use std::collections::HashMap;
/// An entry in the storage
struct Entry<T>(T);
/// A storage container
pub struct Storage<T> {
content: HashMap<String, Entry<T>>,
}
impl<T> Storage<T> {
pub(super) fn insert(&mut self, item: T) -> Result<(), ()> {
Err(())
}
}