kitchen-freezer/src/data/task.rs

20 lines
609 B
Rust
Raw Normal View History

2021-02-18 12:02:04 +01:00
use uuid::Uuid;
2021-02-19 07:58:53 +01:00
pub type TaskId = Uuid;
2021-02-18 12:02:04 +01:00
/// A to-do task
pub struct Task {
2021-02-19 07:58:53 +01:00
id: TaskId,
2021-02-18 12:02:04 +01:00
name: String,
}
impl Task {
pub fn id(&self) -> Uuid { self.id }
pub fn name(&self) -> String { self.name }
pub fn completed(&self) -> bool { self.completed }
pub fn set_completed(&mut self) {
// TODO: either require a reference to the DataSource, so that it is aware
// or change a flag here, and the DataSource will be able to check the flags of all its content (but then the Calendar should only give a reference/Arc, not a clone)
}
}