pub struct TaskManager {
pub tasks: Vec<Task>,
/* private fields */
}Expand description
Manages a collection of tasks
Fields§
§tasks: Vec<Task>Implementations§
Source§impl TaskManager
impl TaskManager
Sourcepub fn get_task_mut(&mut self, id: u32) -> Option<&mut Task>
pub fn get_task_mut(&mut self, id: u32) -> Option<&mut Task>
Retrieves a task by ID (mutable)
Sourcepub fn remove_task(&mut self, id: u32)
pub fn remove_task(&mut self, id: u32)
Removes a task by ID
Sourcepub fn to_json_string(&self) -> (String, u32)
pub fn to_json_string(&self) -> (String, u32)
Converts all tasks to a JSON string and returns current ID
Sourcepub fn from_json_string(json_str: &str, current_id: u32) -> Option<Self>
pub fn from_json_string(json_str: &str, current_id: u32) -> Option<Self>
Creates a TaskManager from a JSON string with the given current ID
Trait Implementations§
Source§impl Debug for TaskManager
impl Debug 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 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