pub struct TaskManager {
pub tasks: BTreeMap<String, Task>,
}Expand description
Manager for task lifecycle and dependencies.
Fields§
§tasks: BTreeMap<String, Task>All tasks keyed by task ID.
Implementations§
Source§impl TaskManager
impl TaskManager
Sourcepub fn create(
&mut self,
subject: impl Into<String>,
description: impl Into<String>,
active_form: Option<String>,
metadata: Metadata,
) -> Task
pub fn create( &mut self, subject: impl Into<String>, description: impl Into<String>, active_form: Option<String>, metadata: Metadata, ) -> Task
Create a new task.
Sourcepub fn replace_all(&mut self, tasks: Vec<Task>)
pub fn replace_all(&mut self, tasks: Vec<Task>)
Replace all tasks from display snapshot order.
Sourcepub fn update(
&mut self,
task_id: &str,
status: Option<TaskStatus>,
subject: Option<String>,
description: Option<String>,
active_form: Option<Option<String>>,
owner: Option<Option<String>>,
add_blocks: Option<&[String]>,
add_blocked_by: Option<&[String]>,
metadata: Option<&Metadata>,
) -> Option<Task>
pub fn update( &mut self, task_id: &str, status: Option<TaskStatus>, subject: Option<String>, description: Option<String>, active_form: Option<Option<String>>, owner: Option<Option<String>>, add_blocks: Option<&[String]>, add_blocked_by: Option<&[String]>, metadata: Option<&Metadata>, ) -> Option<Task>
Update one task and resolve dependencies when completed.
Sourcepub fn export_tasks(&self) -> BTreeMap<String, Value>
pub fn export_tasks(&self) -> BTreeMap<String, Value>
Export task data keyed by task id.
Sourcepub fn from_exported(data: BTreeMap<String, Value>) -> Self
pub fn from_exported(data: BTreeMap<String, Value>) -> Self
Restore from exported task data.
Trait Implementations§
Source§impl Clone for TaskManager
impl Clone for TaskManager
Source§fn clone(&self) -> TaskManager
fn clone(&self) -> TaskManager
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TaskManager
impl Debug for TaskManager
Source§impl Default for TaskManager
impl Default for TaskManager
Source§fn default() -> TaskManager
fn default() -> TaskManager
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for TaskManager
impl<'de> Deserialize<'de> for TaskManager
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TaskManager
Source§impl PartialEq for TaskManager
impl PartialEq for TaskManager
Source§impl Serialize for TaskManager
impl Serialize for TaskManager
impl StructuralPartialEq for TaskManager
Auto Trait Implementations§
impl Freeze for TaskManager
impl RefUnwindSafe for TaskManager
impl Send for TaskManager
impl Sync for TaskManager
impl Unpin for TaskManager
impl UnsafeUnpin for TaskManager
impl UnwindSafe for TaskManager
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