pub struct TodoService<'a> { /* private fields */ }Implementations§
Source§impl<'a> TodoService<'a>
impl<'a> TodoService<'a>
pub fn new(db: &'a Database) -> Self
pub fn add_todo( &self, task_id: i64, content: &str, worktree_requested: bool, ) -> Result<Todo>
pub fn get_todo(&self, todo_id: i64) -> Result<Todo>
pub fn list_todos(&self, task_id: i64) -> Result<Vec<Todo>>
pub fn get_todo_by_index(&self, task_id: i64, task_index: i64) -> Result<Todo>
Sourcepub fn update_status(&self, todo_id: i64, status: &str) -> Result<()>
pub fn update_status(&self, todo_id: i64, status: &str) -> Result<()>
Updates a TODO status from a CLI/API string value.
Sourcepub fn transition_status(
&self,
todo_id: i64,
new_status: TodoStatus,
) -> Result<()>
pub fn transition_status( &self, todo_id: i64, new_status: TodoStatus, ) -> Result<()>
Applies a validated status transition.
pub fn delete_todo(&self, todo_id: i64) -> Result<()>
Sourcepub fn move_to_next(&self, task_id: i64, task_index: i64) -> Result<()>
pub fn move_to_next(&self, task_id: i64, task_index: i64) -> Result<()>
Move a TODO to the front (make it the next todo to work on)
This reorders the task_index so that the specified todo becomes the oldest pending todo. Only pending todos are affected by the reordering.
Sourcepub fn copy_incomplete_todos(
&self,
from_task_id: i64,
to_task_id: i64,
) -> Result<HashMap<i64, i64>>
pub fn copy_incomplete_todos( &self, from_task_id: i64, to_task_id: i64, ) -> Result<HashMap<i64, i64>>
Copies incomplete (pending) todos from one task to another.
Returns a mapping of old task_index to new task_index for the copied todos. This mapping is used to copy linked scraps.
§Arguments
from_task_id- The task ID to copy fromto_task_id- The task ID to copy to
§Returns
A HashMap mapping old task_index values to new task_index values.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for TodoService<'a>
impl<'a> !Send for TodoService<'a>
impl<'a> !Sync for TodoService<'a>
impl<'a> !UnwindSafe for TodoService<'a>
impl<'a> Freeze for TodoService<'a>
impl<'a> Unpin for TodoService<'a>
impl<'a> UnsafeUnpin for TodoService<'a>
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