pub struct TaskStore {
pub tasks: Vec<TaskItem>,
pub next_id: u32,
}Fields§
§tasks: Vec<TaskItem>§next_id: u32Last id handed out; 0 means the first task gets id 1.
Implementations§
Source§impl TaskStore
impl TaskStore
Sourcepub fn create(
&mut self,
specs: Vec<TaskSpec>,
origin: TaskOrigin,
stamp: Stamp,
) -> Vec<u32>
pub fn create( &mut self, specs: Vec<TaskSpec>, origin: TaskOrigin, stamp: Stamp, ) -> Vec<u32>
Append new tasks in order, assigning ids. Returns the assigned ids.
A spec flagged in_progress is stamped as started.
Sourcepub fn apply(&mut self, edits: &[TaskEdit], stamp: Stamp) -> ApplyReport
pub fn apply(&mut self, edits: &[TaskEdit], stamp: Stamp) -> ApplyReport
Apply each edit independently; unknown or deleted ids become per-item errors, valid edits still land. Status transitions pick up cost stamps. Soft-validation notes compare the store before and after the batch.
Sourcepub fn record_evidence(&mut self, entry: EvidenceEntry) -> bool
pub fn record_evidence(&mut self, entry: EvidenceEntry) -> bool
Record evidence against the current in-progress task, if any. Returns whether an entry was recorded.
Sourcepub fn visible(&self) -> impl Iterator<Item = &TaskItem>
pub fn visible(&self) -> impl Iterator<Item = &TaskItem>
All non-deleted tasks, in creation order.
Sourcepub fn progress_string(&self) -> String
pub fn progress_string(&self) -> String
Compact progress label, e.g. Tasks 2/5.
pub fn is_empty(&self) -> bool
pub fn all_done(&self) -> bool
Sourcepub fn active(&self) -> Option<&TaskItem>
pub fn active(&self) -> Option<&TaskItem>
The current in-progress task (first, if the model broke discipline).
Sourcepub fn next_pending(&self) -> Option<&TaskItem>
pub fn next_pending(&self) -> Option<&TaskItem>
The next pending task, in creation order.
Sourcepub fn newly_completed<'a>(&'a self, before: &TaskStore) -> Vec<&'a TaskItem>
pub fn newly_completed<'a>(&'a self, before: &TaskStore) -> Vec<&'a TaskItem>
Tasks that flipped to Completed relative to before — drives the
task_completed hook.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TaskStore
impl<'de> Deserialize<'de> for TaskStore
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 StructuralPartialEq for TaskStore
Auto Trait Implementations§
impl Freeze for TaskStore
impl RefUnwindSafe for TaskStore
impl Send for TaskStore
impl Sync for TaskStore
impl Unpin for TaskStore
impl UnsafeUnpin for TaskStore
impl UnwindSafe for TaskStore
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more