pub struct Board {
pub tasks: Vec<Task>,
pub next_id: u32,
}Expand description
Everything the user and the agent share.
This is Agent::State, so it round-trips: the agent publishes it, the
client mirrors it, and the client sends it back with the next run. Ids and
estimates therefore survive a run boundary without the agent storing
anything.
Fields§
§tasks: Vec<Task>Every task, in the order they were added.
next_id: u32The id the next task will get.
Implementations§
Source§impl Board
impl Board
Sourcepub fn find(&self, needle: &str) -> Option<&Task>
pub fn find(&self, needle: &str) -> Option<&Task>
Finds a task by id, or by a case-insensitive substring of its title.
complete 2 and complete book the room both have to work, because
both are what a person types.
Sourcepub fn complete(&mut self, needle: &str) -> Option<&Task>
pub fn complete(&mut self, needle: &str) -> Option<&Task>
Marks a task done. Returns it, or None if nothing matched.
Sourcepub fn estimate(&mut self, needle: &str, minutes: u32) -> Option<&Task>
pub fn estimate(&mut self, needle: &str, minutes: u32) -> Option<&Task>
Puts an estimate on a task. Returns it, or None if nothing matched.
Sourcepub fn clear(&mut self) -> usize
pub fn clear(&mut self) -> usize
Removes every task and returns how many there were. Ids keep counting, so a cleared board does not reuse them.
Sourcepub fn remaining_minutes(&self) -> u32
pub fn remaining_minutes(&self) -> u32
Total estimated minutes over the tasks that still have to be done.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Board
impl<'de> Deserialize<'de> for Board
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>,
impl Eq for Board
impl StructuralPartialEq for Board
Auto Trait Implementations§
impl Freeze for Board
impl RefUnwindSafe for Board
impl Send for Board
impl Sync for Board
impl Unpin for Board
impl UnsafeUnpin for Board
impl UnwindSafe for Board
Blanket Implementations§
impl<T> AgentState for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.